aboutsummaryrefslogtreecommitdiff
path: root/.config
diff options
context:
space:
mode:
authorsrdusr <trevorgray@srdusr.com>2023-05-16 16:19:48 +0200
committersrdusr <trevorgray@srdusr.com>2023-05-16 16:19:48 +0200
commit9ee603d6dd79b05b94da40c8ee6c6305d4c2f8d0 (patch)
treef74ec188a1eb211ab4010da53945d96a9504eff5 /.config
parentb1c5565924725f7c94e0cd8677ea8914aa0aba45 (diff)
downloaddotfiles-9ee603d6dd79b05b94da40c8ee6c6305d4c2f8d0.tar.gz
dotfiles-9ee603d6dd79b05b94da40c8ee6c6305d4c2f8d0.zip
Fixed toggle fg/bg function
Diffstat (limited to '.config')
-rw-r--r--.config/zsh/.zshrc15
1 files changed, 11 insertions, 4 deletions
diff --git a/.config/zsh/.zshrc b/.config/zsh/.zshrc
index 4564568..15f7d29 100644
--- a/.config/zsh/.zshrc
+++ b/.config/zsh/.zshrc
@@ -298,10 +298,17 @@ getstate () {
}
# use ctrl-z to toggle in and out of bg
-if [[ $- == *i* ]]; then
- stty susp undef
- bind '"\C-z":" fg\015"'
-fi
+function toggle_fg_bg() {
+ if [[ $#BUFFER -eq 0 ]]; then
+ BUFFER="fg"
+ zle accept-line
+ else
+ BUFFER=""
+ zle clear-screen
+ fi
+}
+zle -N toggle_fg_bg
+bindkey '^Z' toggle_fg_bg
# cd using "up n" as a command up as many directories, example "up 3"
up() {