]> arthur.barton.de Git - ax-zsh.git/blobdiff - core/11_terminal/11_terminal.zshrc
Keep $AXZSH variable in axttyinfo alias
[ax-zsh.git] / core / 11_terminal / 11_terminal.zshrc
index 3a2099e2166cdf2f9ea9202d57a8f8cdb8fcc023..3990129368f10b44c800fbb280b9e49f5cfabef8 100644 (file)
@@ -47,6 +47,7 @@ function _axzsh_is_widechar_terminal {
 # Test for "modern" terminal
 function axzsh_is_modern_terminal {
        [[ "$TERM" = cygwin ]] && return 0
+       [[ "$TERM" = putty* ]] && return 0
        [[ "$TERM" = screen* ]] && return 0
        [[ "$TERM" = tmux* ]] && return 0
        [[ "$TERM" = xterm* ]] && return 0
@@ -82,14 +83,14 @@ function axzsh_terminal_set_window_title {
 # Update terminal titles befor echoing the shell prompt
 function axzsh_terminal_title_precmd {
        axzsh_is_modern_terminal || return
-       axzsh_terminal_set_icon_title 'zsh'
+       axzsh_terminal_set_window_title ''
        if [[ "$TERM_PROGRAM" == "Apple_Terminal" && "$TERM" != "screen"* ]]; then
-               axzsh_terminal_set_window_title "$LOGNAME@$SHORT_HOST"
+               axzsh_terminal_set_icon_title "$LOGNAME@$SHORT_HOST"
                # Update CWD in Terminal.app
                local url=$(echo "file://$HOSTNAME$PWD" | sed -e 's| |%20|g')
                printf '\e]7;%s\a' "$url"
        else
-               axzsh_terminal_set_window_title "$LOGNAME@$SHORT_HOST:$PWD"
+               axzsh_terminal_set_icon_title "$LOGNAME@$SHORT_HOST:$PWD"
        fi
 }
 
@@ -114,23 +115,22 @@ function axzsh_terminal_title_preexec {
                        printf '\e]7;%s\a' ''
                fi
        fi
-       if [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then
-               # iTerm.app ...
-               [[ -n "$cmd" ]] && TITLE_ADD=" – $cmd"
-       fi
 
-       axzsh_terminal_set_icon_title "$cmd"
+       if [[ -n "$cmd" ]]; then
+               # Add the command to the title
+               TITLE_ADD=" – $cmd"
+       fi
 
        if [[ -z "$remote" ]]; then
-               axzsh_terminal_set_window_title "$LOGNAME@$SHORT_HOST$TITLE_ADD"
+               axzsh_terminal_set_icon_title "$LOGNAME@$SHORT_HOST$TITLE_ADD"
        else
-               axzsh_terminal_set_window_title "$1"
+               axzsh_terminal_set_icon_title "$1"
        fi
 }
 
 preexec_functions+=(axzsh_terminal_title_preexec)
 
-alias axttyinfo="nocorrect zsh $AXZSH/bin/axttyinfo"
+alias axttyinfo="zsh \"\$AXZSH/bin/axttyinfo\""
 
 axzsh_is_dumb_terminal && return 0