From c2b3afb04fe9ab469ebe18a37caa8676ea9d71bc Mon Sep 17 00:00:00 2001 From: Jonathan Hodgson Date: Wed, 29 Jul 2020 17:20:45 +0100 Subject: [PATCH] Makes fg-bg work on more listeners --- shells/zsh/includes/keybindings.zsh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/shells/zsh/includes/keybindings.zsh b/shells/zsh/includes/keybindings.zsh index d6ec02c9..aa714753 100644 --- a/shells/zsh/includes/keybindings.zsh +++ b/shells/zsh/includes/keybindings.zsh @@ -65,16 +65,16 @@ bindkey -M viins jj vi-cmd-mode function fg-bg() { if [[ $#BUFFER -eq 0 ]]; then local backgroundProgram="$(jobs | tail -n 1 | awk '{print $4}')" - if [[ "$backgroundProgram" == "nc" ]] || [[ "$backgroundProgram" == "ncat" ]]; then - # Make sure that /dev/tty is given to the stty command - local columns=$(stty -a < /dev/tty | grep -oE 'columns [0-9]+' | cut -d' ' -f2) - local rows=$(stty -a < /dev/tty | grep -oE 'rows [0-9]+' | cut -d' ' -f2) - notify-send "Terminal dimensions" "Rows: $rows\nColumns: $columns\nstty command on clipboard" - echo "stty rows $rows cols $columns" | clip - stty raw -echo < /dev/tty; fg - else - fg - fi + case "$backgroundProgram" in + "nc"|"ncat"|"netcat"|"resize-netcat-listener"|"rnc") + # Make sure that /dev/tty is given to the stty command by doing