Append, rather than prepend to PROMPT_COMMAND
This commit is contained in:
1 parent
8aac576b7c
commit
54be46728d
3 files changed
+5
-5
No files matched your search
@@ -109,9 +109,9 @@ ENVIRONMENT
|
||||
resolving of symlinks. If it is not set, symbolic links will be
|
||||
resolved when added to the datafile.
|
||||
|
||||
In bash, z prepends a command to the PROMPT_COMMAND environment vari-
|
||||
able to maintain its database. In zsh, z appends a function _z_precmd
|
||||
to the precmd_functions array.
|
||||
In bash, z appends a command to the PROMPT_COMMAND environment variable
|
||||
to maintain its database. In zsh, z appends a function _z_precmd to the
|
||||
precmd_functions array.
|
||||
|
||||
The environment variable $_Z_NO_PROMPT_COMMAND can be set if you want
|
||||
to handle PROMPT_COMMAND or precmd yourself.
|
||||
|
||||
@@ -134,7 +134,7 @@ The environment variable \fB$_Z_NO_RESOLVE_SYMLINKS\fR can be set to prevent
|
||||
resolving of symlinks. If it is not set, symbolic links will be resolved when
|
||||
added to the datafile.
|
||||
.P
|
||||
In bash, \fBz\fR prepends a command to the \fBPROMPT_COMMAND\fR environment
|
||||
In bash, \fBz\fR appends a command to the \fBPROMPT_COMMAND\fR environment
|
||||
variable to maintain its database. In zsh, \fBz\fR appends a function
|
||||
\fB_z_precmd\fR to the \fBprecmd_functions\fR array.
|
||||
.P
|
||||
|
||||
@@ -218,7 +218,7 @@ elif complete &> /dev/null; then
|
||||
[ "$_Z_NO_PROMPT_COMMAND" ] || {
|
||||
# bash populate directory list. avoid clobbering other PROMPT_COMMANDs.
|
||||
echo $PROMPT_COMMAND | grep -q "_z --add" || {
|
||||
PROMPT_COMMAND='_z --add "$(pwd '$_Z_RESOLVE_SYMLINKS' 2>/dev/null)" 2>/dev/null;'"$PROMPT_COMMAND"
|
||||
PROMPT_COMMAND="${PROMPT_COMMAND%;}"';_z --add "$(pwd '$_Z_RESOLVE_SYMLINKS' 2>/dev/null)" 2>/dev/null;'
|
||||
}
|
||||
}
|
||||
fi
|
||||
Reference in new issue
Block a user