From ec2de21250e26af3e1315fac72488eda2b32c33c Mon Sep 17 00:00:00 2001 From: Andrew Cady Date: Sat, 26 Aug 2023 10:41:16 -0400 Subject: improve clarity --- src/rpc.bash | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src') 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() "$@" } +read_stdin() +{ + REPLY= + read -r -N2147483647 || [ "$REPLY" ] +} + remote_run_function_tty() { main=$1 @@ -125,10 +131,12 @@ remote_run_function_tty() ( TERM="$stage2_source" export TERM - read -r bashcode <<'END' -:; rpc=$TERM; TERM=screen; source <(printf '%s' "$rpc") + read_stdin <<'END' + rpc=$TERM + TERM=screen + source <(printf '%s' "$rpc") END - exec ssh localhost -t -- bash -c "${bashcode@Q}" bash "$@" + exec ssh localhost -t -- bash -c "${REPLY@Q}" bash "$@" ) } -- cgit v1.2.3