Parcourir la source

Adds ctrl+z at empty prompt resumes background job

Tom McKenzie il y a 5 ans
Parent
commit
a9dcde2767
1 fichiers modifiés avec 13 ajouts et 0 suppressions
  1. 13 0
      .zshrc.d/ctrl-z-bg.zsh

+ 13 - 0
.zshrc.d/ctrl-z-bg.zsh

@@ -0,0 +1,13 @@
+# https://unix.stackexchange.com/a/223440
+
+fancy-ctrl-z () {
+  if [[ $#BUFFER -eq 0 ]]; then
+    bg
+    zle redisplay
+  else
+    zle push-input
+  fi
+}
+
+zle -N fancy-ctrl-z
+bindkey '^Z' fancy-ctrl-z