Skip to content

vk-agent/ssh: run an exec on the pty the client asked for - #7

Open
shelleu-wallix wants to merge 1 commit into
virtkit-dev:mainfrom
shelleu-wallix:fix/ssh-pty-exec
Open

shelleu-wallix wants to merge 1 commit into
virtkit-dev:mainfrom
shelleu-wallix:fix/ssh-pty-exec

Conversation

@shelleu-wallix

Copy link
Copy Markdown
Contributor

A pty-req followed by exec (ssh -t host cmd) ran the command on pipes and left the pty unused, as sshd does not.

Zed opens every remote terminal as ssh -t host 'cd <dir>; exec $SHELL -l', so its shell came up non-interactive, with no prompt, waiting on a stdin nobody wrote to: the terminal hung.

The command now runs as $SHELL -c on that pty, bridged like the interactive shell (resizes, hang-up, exit status). An exec without a pty keeps its pipes and separate stderr.

A pty-req followed by exec (`ssh -t host cmd`) ran the command on
pipes and left the pty unused, as sshd does not. Zed opens every remote
terminal as `ssh -t host 'cd <dir>; exec $SHELL -l'`, so its shell came
up non-interactive, with no prompt, waiting on a stdin nobody wrote
to: the terminal hung. The command now runs as `$SHELL -c` on that
pty, bridged like the interactive shell (resizes, hang-up, exit
status). An exec without a pty keeps its pipes and separate stderr.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant