From be0e4245a6b693a0e0fd5cfa2cad8add503442ef Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Wed, 26 Sep 2012 16:51:32 -0400 Subject: [PATCH] [Fix #301] Unset $MATCH after use --- modules/prompt/functions/prompt_sorin_setup | 1 + modules/terminal/init.zsh | 2 ++ 2 files changed, 3 insertions(+) diff --git a/modules/prompt/functions/prompt_sorin_setup b/modules/prompt/functions/prompt_sorin_setup index afc531c..6b77687 100644 --- a/modules/prompt/functions/prompt_sorin_setup +++ b/modules/prompt/functions/prompt_sorin_setup @@ -16,6 +16,7 @@ function prompt_sorin_pwd { if [[ "$pwd" == (#m)[/~] ]]; then _prompt_sorin_pwd="$MATCH" + unset MATCH else _prompt_sorin_pwd="${${(@j:/:M)${(@s:/:)pwd}##.#?}:h}/${pwd:t}" fi diff --git a/modules/terminal/init.zsh b/modules/terminal/init.zsh index d5cd3ec..dc78a3b 100644 --- a/modules/terminal/init.zsh +++ b/modules/terminal/init.zsh @@ -68,6 +68,7 @@ function set-titles-with-command { # Set the command name, or in the case of sudo or ssh, the next command. local cmd=${${1[(wr)^(*=*|sudo|ssh|-*)]}:t} local truncated_cmd="${cmd/(#m)?(#c15,)/${MATCH[1,12]}...}" + unset MATCH if [[ "$TERM" == screen* ]]; then set-screen-window-title "$truncated_cmd" @@ -90,6 +91,7 @@ function set-titles-with-path { else local abbreviated_path="${absolute_path/#$HOME/~}" local truncated_path="${abbreviated_path/(#m)?(#c15,)/...${MATCH[-12,-1]}}" + unset MATCH if [[ "$TERM" == screen* ]]; then set-screen-window-title "$truncated_path"