In places, the local statement will override the exit code and the written
command won't have the effect intended when it was written.
For example, when it's not inside a git repo the exit code won't be true,
but the local statement will make it true regardless. See #4708.
Fixes#4085: core -> plugin dependency issue.
Rename it to git_current_branch for clarity that it's git-specific.
Update all plugins that were calling it to use new name.
Fix variable leaks by making more variables in lib/git.zsh local.
Have lib/git.zsh use [[ ]] instead of [ ] everywhere.
Currently, the title is only set on supported terminals (i.e. xterm,
urxvt, screen etc.). Using terminfo entries to set the terminal title
adds support for many more terminals.
This change enables UP-arrow and DOWN-arrow full-line history completion.
For example, if you write `git clone` and press UP:
- Before this change,
it will use the last command that starts with `git`.
- After this change,
it will use the last command that starts with `git clone`.
Otherwise `start` will confuse the first parameter as the title of
a new command prompt if the parameter contains whitespace. That is
because the command to be run will be:
start "abc def"
which opens a new command prompt window with the title "abc def".
With the added empty string we force the start command to interpret
the passed parameter as the file / command:
start "" "abc def"
which will be interpreted like `""` is the title and the rest is
the file or command to start.
-------
**NOTE:** this wouldn't be necessary if the start script in msys
was defined differently; that is, if it had the empty string
already incorporated in the script (/usr/bin/start), like so:
```diff
-cmd //c start "${@//&/^&}"
+cmd //c start "" "${@//&/^&}"
```
Notice however that this would make it impossible to use start
setting a different title, so it's probably best to leave it as is.
More info: http://sourceforge.net/p/msys2/tickets/14/
-------
The change `${(z)open_cmd}` is necessary to force zsh to split the
variable by the spaces and interpret it as separate words.
More info: http://zsh.sourceforge.net/FAQ/zshfaq03.html#l17
Apparently `nohup` is not needed in OSX, and using it has the side
that it may break under tmux with the error
nohup: can't detach from console: No such file or directory
For now, this commit only drops the use of `nohup` in OSX. But it
*may* not be necessary under other similar platforms.
Uniform git prompt equal remote to all others prompts, setting the correct symbol
(if applicable) to $git_remote_status, instead of echoing it.
It also solves the problem pointed out in #3911
This commit uses the (hopefully) standard rmam and smam escape sequences
which toggle off and on line wrapping respectively.
This is so that extra dots that don't fit the current line won't be
displayed in the next line, which would in turn make the shell
display a new prompt on the next line after the dots are hidden.
I've added a check for $terminfo rmam and smam values to be sure we have
them before printing them out.
If this commit breaks something post an issue with your terminal
emulator and $TERM value and we'll figure out what went wrong.
shasum seems more widely available than md5/md5sum, and we don't have to worry about dealing with the different signatures and output formats of md5 and md5sum then.
sysinfo outputs localized message labels, so we can't just grep for "OS Type". But OS is the first thing it outputs, so we can probably just grab those lines by line number. Switched to doing that.
A new "lib/compfix.zsh" script defining a new handle_completion_insecurities()
function has been added, which handles insecure completion directories by
notifying users of said insecurities and moving away all existing completion
caches to a temporary directory. While intended to be called at startup, this
function is generally callable at any time (e.g., for testing).
This adds two new theme functions for git:
* `git_prompt_behind` works in a identical fashion to `git_prompt_ahead`
and will output a format variable (`ZSH_THEME_GIT_PROMPT_BEHIND`) if
the branch is behind.
* `git_prompt_remote` will output one format variable if the branch
exists on remote (`ZSH_THEME_GIT_PROMPT_REMOTE_EXISTS`), and another
if the branch is unpublished (`ZSH_THEME_GIT_PROMPT_REMOTE_MISSING`).
The old `git_prompt_ahead` has been changed. Using git log is subject
to formatting in .gitconfig, which can be overridden and will break
this function. Relying on rev-list is much more stable.
LANG is a colon-separated list of prefered locales; LC_CTYPE is single entry,
therefore we need to remove all but one entry.
Also, there is no need setting it if it is already set (LC_ALL also sets
LC_CTYPE, so we check it too).
Move the DISABLE_AUTO_TITLE check from title() to the preX hook
functions that call it, to allow the title() function to be used
directly by user or other callers.