diff options
author | Andrew Cady <d@jerkface.net> | 2024-08-14 17:02:21 -0400 |
---|---|---|
committer | Andrew Cady <d@jerkface.net> | 2024-08-14 17:02:21 -0400 |
commit | 77fdb8c5e0a40ae3adddf470567868a6a93a1102 (patch) | |
tree | bd2747fdfd02229adc81953407a284383959b80c /twopane.bash | |
parent | e569bf7b4f093823601821717b3bfc75cd4c601d (diff) |
use block syntax for temporarily redirecting stderr
Diffstat (limited to 'twopane.bash')
-rwxr-xr-x | twopane.bash | 7 |
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 |