summaryrefslogtreecommitdiff
path: root/src/read-tty
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2024-08-20 21:18:44 -0400
committerAndrew Cady <d@jerkface.net>2024-08-20 21:18:44 -0400
commit62440f41b97fbe85787bb015c9f52bf7e329b97c (patch)
tree5cbc3fcd0f7c4062d8def07b50bccfd37d316f0c /src/read-tty
parentbd3d815e9c3757414b50225ba2c427ab8ff298e7 (diff)
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
Diffstat (limited to 'src/read-tty')
-rwxr-xr-xsrc/read-tty5
1 files changed, 5 insertions, 0 deletions
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 @@
1#!/bin/bash 1#!/bin/bash
2BASH_ARGV0=read-tty
3echo -n "$0" >/proc/$BASHPID/comm
2: "${BASH_LOADABLES_PATH:=/lib/bash:/usr/lib/bash:/usr/local/lib/bash:$HOME/.local/lib/bash}" 4: "${BASH_LOADABLES_PATH:=/lib/bash:/usr/lib/bash:/usr/local/lib/bash:$HOME/.local/lib/bash}"
3enable -f sleep sleep 5enable -f sleep sleep
4source read_chars.bash 6source read_chars.bash
5:|: 7:|:
6export COLUMNS 8export COLUMNS
7( 9(
10 BASH_ARGV0=read-tty-subshell
11 echo -n "$0" >/proc/$BASHPID/comm
12 trap 'x /bin/kill -INT -- -$BASHPID' INT
8 read_chars 13 read_chars
9) 14)