From 62440f41b97fbe85787bb015c9f52bf7e329b97c Mon Sep 17 00:00:00 2001 From: Andrew Cady Date: Tue, 20 Aug 2024 21:18:44 -0400 Subject: many changes basically working the problem is that when the top pane sends SIGUSR1 it does not quit the bottom in the right order and an extra character ends up being read from the terminal in the bottom before a write error signals the end of the connection. Our signal of termination from the top is not reaching the right pid, the pid of the socat inside of the read_char needs to be reached by SIGUSR1, instead of $$ the outermost shell, where killing the job in job control should be enough to break the connection to the tty, it remains probably as long as socat remains running, we need to kill the whole process group of read-tty when killing the main process or when it exits --- src/read-tty | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/read-tty') diff --git a/src/read-tty b/src/read-tty index 799244b..74e2803 100755 --- a/src/read-tty +++ b/src/read-tty @@ -1,9 +1,14 @@ #!/bin/bash +BASH_ARGV0=read-tty +echo -n "$0" >/proc/$BASHPID/comm : "${BASH_LOADABLES_PATH:=/lib/bash:/usr/lib/bash:/usr/local/lib/bash:$HOME/.local/lib/bash}" enable -f sleep sleep source read_chars.bash :|: export COLUMNS ( + BASH_ARGV0=read-tty-subshell + echo -n "$0" >/proc/$BASHPID/comm + trap 'x /bin/kill -INT -- -$BASHPID' INT read_chars ) -- cgit v1.2.3