X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=zsh%2Frc;h=d10736edaacf5c6be9490e8ca3a364e0a8332946;hb=211f5faa3895e4cc6fc2ea7d2ee739ae99468f5f;hp=fbf9aea5196ba5582b5c9738ae85adab1c950f45;hpb=614f9080ac810a2f4c0a5244bca856f3358e625e;p=config%2Fdotfiles.git diff --git a/zsh/rc b/zsh/rc index fbf9aea..d10736e 100644 --- a/zsh/rc +++ b/zsh/rc @@ -328,21 +328,21 @@ $green%B%n%b$default@$green%B%m%b$default %(1j.$yellow%j$default.)%# \ add-zsh-hook precmd prompt_precmd -# When screen, xterm or rxvt is used set the name of the window to the +# When screen, tmux, xterm or rxvt is used set the name of the window to the # currently running program. # # When a program is started preexec() sets the window's name to it; when it # stops precmd() resets the window's name to 'zsh'. 'fg' is supported and sets # the window's name to the resumed job. # -# It works with screen, xterm and rxvt. +# It works with screen, tmux, xterm and rxvt. # # If a command is run with sudo or if the shell is running as root then a ! is # added at the beginning of the command to make this clear. If a command is # running on a different computer with ssh a @ is added at the beginning. If -# screen is running on the remote machine instead of @screen @:hostname -# (hostname replaced by the machine's hostname) is displayed. This only works -# if the .zshrc on the server also uses this command. +# screen/tmux is running on the remote machine instead of @screen @:hostname +# (or @tmux ..; hostname replaced by the machine's hostname) is displayed. +# This only works if the .zshrc on the server also uses this command. # # screen* is necessary as `screen` uses screen.linux for example for a linux # console. @@ -370,7 +370,7 @@ if [[ $TERM == screen* || $TERM == xterm* || $TERM == rxvt* ]]; then # Replace fg with the resumed job name. if [[ $program_name == fg ]]; then program_name=${jobtexts[%+]} - elif [[ $program_name == fg* ]]; then + elif [[ $program_name == fg\ * ]]; then program_name=${jobtexts[${program_name#fg }]} fi @@ -411,10 +411,10 @@ if [[ $TERM == screen* || $TERM == xterm* || $TERM == rxvt* ]]; then # If screen is running in SSH then display "@:hostname" as title # in the term/outer screen. - if [[ $program_name == @screen ]]; then + if [[ $program_name == @screen || $program_name == @tmux ]]; then program_name="@:${HOST//.*/}" # Use "@:!hostname" for root screens. - elif [[ $program_name == @!screen ]]; then + elif [[ $program_name == @!screen || $program_name == @!tmux ]]; then program_name="@:!${HOST//.*/}" fi fi @@ -451,9 +451,9 @@ if [[ $TERM == screen* || $TERM == xterm* || $TERM == rxvt* ]]; then window_reset= } - # Sets the window title. Works with screen, xterm and rxvt. (V) escapes - # all non-printable characters. Thanks to Mikachu in #zsh on Freenode - # (2010-08-07 17:09 CEST). + # Sets the window title. Works with screen, tmux (which uses screen as + # TERM), xterm and rxvt. (V) escapes all non-printable characters. Thanks + # to Mikachu in #zsh on Freenode (2010-08-07 17:09 CEST). if [[ $TERM == screen* ]]; then window_title() { print -n "\ek${(V)1}\e\\" @@ -739,7 +739,7 @@ done &) # Run reminder and redisplay it every four hours (if it's available). PERIOD=14400 periodic() { - which rem > /dev/null && [ -f ~/.reminders ] && rem -h + (( $+commands[rem] )) && [ -f ~/.reminders ] && rem -h }