bash_completion: Define dummy function to suppress errors
Define a dummy _init_completion() function, which some bash-completion
scripts do call (for example fail2ban-client ...): this doesn't make the
completion usable, but suppresses error messages at least ...
11_terminal: Set "icon/tab title", not the "window" title
Don't set the "window title" at all (and reset it before showing the
new prompt), and set the "icon title" ("tab title") instead: this gives
a much better experience when using tabs in Terminal.app and iTerm2.app,
especially when mixing tabbed and non-tabbed windows.
Alexander Barton [Mon, 22 Apr 2019 15:45:57 +0000 (17:45 +0200)]
11_terminal: Fix & enhance initialization of FG, BG, FX arrays
This includes support for 16 colors as well as 256 colors.
Other fixes:
- Enhance documentation a little bit.
- Don't use raw ESC codes, use \e instead!
- Remove unneeded %{...%} escaping in spectrum_XXX() functions.
Alexander Barton [Mon, 22 Apr 2019 15:38:33 +0000 (17:38 +0200)]
Fix handling of legacy terminal types
Disable plugins/code requiring current terminal features not only on
"dumb" terminals, but on legacy ("not modern") terminals, too. This is
handled by using the axzsh_is_modern_terminal() function insetad of
axzsh_is_dumb_terminal().
And fix plugins to return 91 ("ignore") as result code in this case.
In addition, disable theming only on dumb terminals (as before), but
fall back to the standard "ax" theme on non-modern terminals, too!
50_prompt: Move VCS prompt styling into VCS plugin
This is required because some 3rd-party themes written for OhMyZsh call
git_prompt_info() directly, and don't use ax_vcs_prompt(), and therefore
havn't had their VCS prefix and postfix shown ...
Don't include theme into the cache, only the "source" command
This was the case earlier on, before moving this logic into ax.zsh,
and is required by some more complex themes like Powerlevel9k (that
fail to find/include some other resource file otherwise ...).
Implement axzshctl function, restarting the current shell
The new axzshctl function, which shadows the axzshctl shell script,
tries to detect when there potentially were changes to the setup and
restarts the running shell in that case, bringing the new configuration
in effect immediately.
Now the user doesn't have to restart his shell manually any more.
Force creating the symlink, overwriting a possibly already existing one.
This prevents us from having no theme link at all, if something goes
wrong ;-)
Alexander Barton [Sun, 11 Feb 2018 10:12:23 +0000 (11:12 +0100)]
Enhance support for remote plugins with embedded themes
Enable a theme in a remote plugins automatically when cloning and
enabling the plugin itself, and add support to enable such themes
using the regular "axzshctl set-theme" command.
Alexander Barton [Mon, 20 Nov 2017 23:28:47 +0000 (00:28 +0100)]
Don't load themes and ext. plugins on "dumb" terminals
These external (and modern?) plugins most probably don't expect such an
unusual old terminal configuration and don't behave well (echo color
sequences, for example). Therefore we DON'T load any external plugins at
all when running on such a terminal: this results in reduced/disabled
functionality, but hopefully in readable output ...
And the same is true for any themes, included or external: we disable
them and fallback to an included very simple but sane default prompt.
This plugin implements a "cheat" function and uses http://cheat.sh
to download cheat sheet information. It supports curl(1) as well as
wget(1) and uses the "monokai" theme.
11_terminal: Make axzsh_is_widechar_terminal() safer
Sometimes there were leftover artifacts of the escape sequence visible
in screen(1) and tmux(1), but not always. Anyways, with the splitted
echoing of the escape sequence, at least I wasn't able to reproduce it
any more, so hopefully this fixes the problem for everybody.
At the moment, this function is used by the "axemoji" theme and the
default "right side error prompt" to not use wide characters that would
destroy the layout of the terminal used.
Alexander Barton [Sat, 15 Apr 2017 22:41:34 +0000 (00:41 +0200)]
30_hostname: Validate SHORT_HOST variable
Old(er) versions of hostnamectl(1) don't support the "--pretty"
parameter but output verbose text showing all information. So
validate the SHORT_HOST variable afterwards and unset it again
when it contains ":" characters: then the fallback is used.