Created
March 27, 2011 18:53
-
-
Save derekjw/889468 to your computer and use it in GitHub Desktop.
diff to fix oh-my-zsh not working properly with screen
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh | |
index e1e5366..3b7b500 100644 | |
--- a/lib/termsupport.zsh | |
+++ b/lib/termsupport.zsh | |
@@ -3,7 +3,7 @@ | |
#Fully support screen, iterm, and probably most modern xterm and rxvt | |
#Limited support for Apple Terminal (Terminal can't set window or tab separately) | |
function title { | |
- if [[ "$TERM" == "screen" ]]; then | |
+ if [[ $TERM =~ "^screen" ]]; then | |
print -Pn "\ek$1\e\\" #set screen hardstatus, usually truncated at 20 chars | |
elif [[ ($TERM =~ "^xterm") ]] || [[ ($TERM == "rxvt") ]] || [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then | |
print -Pn "\e]2;$2\a" #set window name | |
@@ -21,6 +21,8 @@ function precmd { | |
#Appears at the beginning of (and during) of command execution | |
function preexec { | |
+ emulate -L zsh | |
+ setopt extended_glob | |
local CMD=${1[(wr)^(*=*|sudo|ssh|-*)]} #cmd name only, or if this is sudo or ssh, the next cmd | |
title "$CMD" "%100>...>$2%<<" | |
} |
No I haven't. I'll clean up the commits in my repo and submit a pull request. Thanks for the reminder.
Ok I had a fix to push myself so I included yours: ohmyzsh/ohmyzsh#266
Looks good, thanks.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Did you do a pull request upstream for this fix, this is definitly harmless (as the option is only set locally) and more bulletproof.