X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=etc%2Fzsh%2Fzshrc;h=4178304e565ec66d61982ff0fb179d4f70be21d2;hb=442da815e7724dc8601329d6f725a9f65e656382;hp=e30f5118465931c7c5666c9972a9216b43e4946a;hpb=e7f84863ff37d54cc2b99e259b4aa2698543a767;p=grml-etc-core.git diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index e30f511..4178304 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -912,8 +912,19 @@ zle -N insert-last-typed-word; #k# Insert last typed word bindkey "\em" insert-last-typed-word -#k# Shortcut for \kbd{fg} -bindkey -s '^z' "fg\n" +function grml-zsh-fg() { + if (( ${#jobstates} )); then + zle .push-input + [[ -o hist_ignore_space ]] && BUFFER=' ' || BUFFER='' + BUFFER="${BUFFER}fg" + zle .accept-line + else + zle -M 'No background jobs. Doing nothing.' + fi +} +zle -N grml-zsh-fg +#k# A smart shortcut for \kbd{fg} +bindkey '^z' grml-zsh-fg # run command line as user root via sudo: sudo-command-line() { @@ -2956,7 +2967,7 @@ iwclient() { # spawn a minimally set up mksh - useful if you want to umount /usr/. minimal-shell() { emulate -L zsh - local shell="mksh" + local shell="/bin/mksh" if ! check_com -c ${shell}; then printf '`%s'\'' not available, giving up.\n' ${shell} >&2