1
0
mirror of https://github.com/dcarrillo/prezto.git synced 2024-12-22 17:28:01 +00:00

[Fix #301] Unset $MATCH after use

This commit is contained in:
Sorin Ionescu 2012-09-26 16:51:32 -04:00
parent 1dfc0bf784
commit be0e4245a6
2 changed files with 3 additions and 0 deletions

View File

@ -16,6 +16,7 @@ function prompt_sorin_pwd {
if [[ "$pwd" == (#m)[/~] ]]; then if [[ "$pwd" == (#m)[/~] ]]; then
_prompt_sorin_pwd="$MATCH" _prompt_sorin_pwd="$MATCH"
unset MATCH
else else
_prompt_sorin_pwd="${${(@j:/:M)${(@s:/:)pwd}##.#?}:h}/${pwd:t}" _prompt_sorin_pwd="${${(@j:/:M)${(@s:/:)pwd}##.#?}:h}/${pwd:t}"
fi fi

View File

@ -68,6 +68,7 @@ function set-titles-with-command {
# Set the command name, or in the case of sudo or ssh, the next command. # Set the command name, or in the case of sudo or ssh, the next command.
local cmd=${${1[(wr)^(*=*|sudo|ssh|-*)]}:t} local cmd=${${1[(wr)^(*=*|sudo|ssh|-*)]}:t}
local truncated_cmd="${cmd/(#m)?(#c15,)/${MATCH[1,12]}...}" local truncated_cmd="${cmd/(#m)?(#c15,)/${MATCH[1,12]}...}"
unset MATCH
if [[ "$TERM" == screen* ]]; then if [[ "$TERM" == screen* ]]; then
set-screen-window-title "$truncated_cmd" set-screen-window-title "$truncated_cmd"
@ -90,6 +91,7 @@ function set-titles-with-path {
else else
local abbreviated_path="${absolute_path/#$HOME/~}" local abbreviated_path="${absolute_path/#$HOME/~}"
local truncated_path="${abbreviated_path/(#m)?(#c15,)/...${MATCH[-12,-1]}}" local truncated_path="${abbreviated_path/(#m)?(#c15,)/...${MATCH[-12,-1]}}"
unset MATCH
if [[ "$TERM" == screen* ]]; then if [[ "$TERM" == screen* ]]; then
set-screen-window-title "$truncated_path" set-screen-window-title "$truncated_path"