summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2023-08-26 10:41:16 -0400
committerAndrew Cady <d@jerkface.net>2023-08-26 10:41:16 -0400
commitec2de21250e26af3e1315fac72488eda2b32c33c (patch)
treeabe71712015955140ea8d12c48ee1e53b5a7c549
parent09b30ddf5d4b1e7ff72fa07b7d8a0563ecb949cf (diff)
improve clarity
-rw-r--r--src/rpc.bash14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/rpc.bash b/src/rpc.bash
index 5e39851..cceadec 100644
--- a/src/rpc.bash
+++ b/src/rpc.bash
@@ -113,6 +113,12 @@ remote_run_function_notty()
113 "$@" 113 "$@"
114} 114}
115 115
116read_stdin()
117{
118 REPLY=
119 read -r -N2147483647 || [ "$REPLY" ]
120}
121
116remote_run_function_tty() 122remote_run_function_tty()
117{ 123{
118 main=$1 124 main=$1
@@ -125,10 +131,12 @@ remote_run_function_tty()
125 ( 131 (
126 TERM="$stage2_source" 132 TERM="$stage2_source"
127 export TERM 133 export TERM
128 read -r bashcode <<'END' 134 read_stdin <<'END'
129:; rpc=$TERM; TERM=screen; source <(printf '%s' "$rpc") 135 rpc=$TERM
136 TERM=screen
137 source <(printf '%s' "$rpc")
130END 138END
131 exec ssh localhost -t -- bash -c "${bashcode@Q}" bash "$@" 139 exec ssh localhost -t -- bash -c "${REPLY@Q}" bash "$@"
132 ) 140 )
133} 141}
134 142