Append, rather than prepend to PROMPT_COMMAND

This commit is contained in:
rupa committed 2013-05-27 14:16:38 -04:00
1 parent 8aac576b7c
commit 54be46728d
3 files changed
+6 -6

No files matched your search

+4 -4
View File
@@ -71,7 +71,7 @@ NOTES
Frecency:
Frecency is a portmanteau of 'recent' and 'frequency'. It is a weighted
rank that depends on how often and how recently something occurred. As
rank that depends on how often and how recently something occurred. As
far as I know, Mozilla came up with the term.
To z, a directory that has low ranking but has been accessed recently
@@ -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.
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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