summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2024-08-14 17:02:21 -0400
committerAndrew Cady <d@jerkface.net>2024-08-14 17:02:21 -0400
commit77fdb8c5e0a40ae3adddf470567868a6a93a1102 (patch)
treebd2747fdfd02229adc81953407a284383959b80c
parente569bf7b4f093823601821717b3bfc75cd4c601d (diff)
use block syntax for temporarily redirecting stderr
-rwxr-xr-xtwopane.bash7
1 files changed, 4 insertions, 3 deletions
diff --git a/twopane.bash b/twopane.bash
index 6322b69..99e0717 100755
--- a/twopane.bash
+++ b/twopane.bash
@@ -229,9 +229,10 @@ forward()
229 # characters with carrot-encoding like '^[' etc). 229 # characters with carrot-encoding like '^[' etc).
230 exec {STDIN}<&0 {STDOUT}>&1 {STDERR}>&2 230 exec {STDIN}<&0 {STDOUT}>&1 {STDERR}>&2
231 exec {TEE}> >(tee >(output_filter | soft_cursor >&$STDOUT) >&$stdout) 231 exec {TEE}> >(tee >(output_filter | soft_cursor >&$STDOUT) >&$stdout)
232 exec 2>/dev/null 232 stty=cfmakeraw,opost=1,onlcr=1
233 socat FD:$STDIN,cfmakeraw,opost=1,onlcr=1!!STDOUT - <&$stdin >&$TEE 2>&$STDERR & 233 {
234 exec 2>&$STDERR 234 socat FD:$STDIN,$stty!!STDOUT - <&$stdin >&$TEE 2>&$STDERR &
235 } 2>/dev/null
235 FORWARD_PID=$! 236 FORWARD_PID=$!
236 printf '%s\n' "#!/bin/bash" "kill $!" "screen -X focus bottom" > "$TWOPANE"/unforward 237 printf '%s\n' "#!/bin/bash" "kill $!" "screen -X focus bottom" > "$TWOPANE"/unforward
237 chmod +x "$TWOPANE"/unforward 238 chmod +x "$TWOPANE"/unforward