X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=zsh%2Frc;h=37befb765de53f99c8213f49513b5f9c8047f41d;hb=b17f39ac88f79c5a8da6dbd2d5b42583acc6309e;hp=4626513a1203a81aa9ae05bac6030ffb0164fd94;hpb=c37517624cb225ecbc5ea8b2fe2d2f12b828a9e8;p=config%2Fdotfiles.git diff --git a/zsh/rc b/zsh/rc index 4626513..37befb7 100644 --- a/zsh/rc +++ b/zsh/rc @@ -112,6 +112,8 @@ setopt appendhistory setopt incappendhistory # If the same command is run multiple times store it only once in the history. setopt histignoredups +# Don't add lines starting with a space to the history. +setopt histignorespace # Vim like completions of previous executed commands (also enter Vi-mode). If # called at the beginning it just recalls old commands (like cursor up), if # called after typing something, only lines starting with the typed text are @@ -315,7 +317,8 @@ add-zsh-hook precmd prompt_precmd # 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'. +# 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. # @@ -348,6 +351,14 @@ if [[ $TERM == screen* || $TERM == xterm* || $TERM == rxvt* ]]; then program_name=${program_name#sudo } program_sudo=yes fi + + # Replace fg with the resumed job name. + if [[ $program_name == fg ]]; then + program_name=${jobtexts[%+]} + elif [[ $program_name == fg* ]]; then + program_name=${jobtexts[${program_name#fg }]} + fi + # Remove all arguments from the program name. program_name=${program_name%% *}