Skip to content

Commit e50c420

Browse files
committed
[it2ssh] drain stdin before reading conductor script
1 parent 21f44e6 commit e50c420

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

utilities/it2ssh

+1-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ send_conductor='printf "%s '"$intro"'"'
152152
# Run a command on the remote host that instructs iTerm2 to send a script, then reads the script and executes it.
153153
# I tried many ways to concatenate s and l and this is the only one that works on both Ubuntu 18 and Ubuntu 20.
154154
esc=$(printf "\033")
155-
sanitized="stty -echo; $send_conductor"';s="";IFS=""; while read -r l;do [ "$l" = "'$esc'" ]&&break; s=$(printf "%s\n%s" "$s" "$l"); done; unset IFS; s=$(echo "$s" | { command -v base64 > /dev/null 2> /dev/null && command base64 -d || { command -v b64encode > /dev/null 2> /dev/null && command fold -w 76 | command b64decode -r; } || echo "echo base64 not available on remote host"; }); eval "$s"'
155+
sanitized="stty -echo; $send_conductor"';s="";IFS=""; while read -r l;do [ "$l" == "-- BEGIN CONDUCTOR --" ]&&break; done; while read -r l; do [ "$l" = "'$esc'" ]&&break; s=$(printf "%s\n%s" "$s" "$l"); done; unset IFS; s=$(echo "$s" | { command -v base64 > /dev/null 2> /dev/null && command base64 -d || { command -v b64encode > /dev/null 2> /dev/null && command fold -w 76 | command b64decode -r; } || echo "echo base64 not available on remote host"; }); eval "$s"'
156156

157157
# If ssh gets a signal, let it2ssh keep running.
158158
set +e

0 commit comments

Comments
 (0)