diff options
author | Andrew Cady <d@jerkface.net> | 2023-08-26 10:41:16 -0400 |
---|---|---|
committer | Andrew Cady <d@jerkface.net> | 2023-08-26 10:41:16 -0400 |
commit | ec2de21250e26af3e1315fac72488eda2b32c33c (patch) | |
tree | abe71712015955140ea8d12c48ee1e53b5a7c549 /src/rpc.bash | |
parent | 09b30ddf5d4b1e7ff72fa07b7d8a0563ecb949cf (diff) |
improve clarity
Diffstat (limited to 'src/rpc.bash')
-rw-r--r-- | src/rpc.bash | 14 |
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 | ||
116 | read_stdin() | ||
117 | { | ||
118 | REPLY= | ||
119 | read -r -N2147483647 || [ "$REPLY" ] | ||
120 | } | ||
121 | |||
116 | remote_run_function_tty() | 122 | remote_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") | ||
130 | END | 138 | END |
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 | ||