ohmyzsh/plugins/fancy-ctrl-z/fancy-ctrl-z.plugin.zsh
lucdanton ab9858c585 Ensure widgets are called with full context.
This allows other plugins that hook e.g. accept-line to identify the
fancy-ctrl-z widget as the caller and take appropriate steps when
necessary.
2016-02-10 06:02:02 +01:00

12 lines
196 B
Bash

fancy-ctrl-z () {
if [[ $#BUFFER -eq 0 ]]; then
BUFFER="fg"
zle accept-line -w
else
zle push-input -w
zle clear-screen -w
fi
}
zle -N fancy-ctrl-z
bindkey '^Z' fancy-ctrl-z