DEV Community

Discussion on: A Guide To Loving Your Terminal

Collapse
 
maxdevjs profile image
maxdevjs

Once I found a fancy function to handle ctrl-z behaviour. As seems that you use zsh and in a similar way, here it is:

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