Connect: Close terminal tab if last input was Ctrl+D, even on non-zero exit code#59836
Merged
Connect: Close terminal tab if last input was Ctrl+D, even on non-zero exit code#59836
Conversation
0b150cd to
e74eb74
Compare
ravicious
commented
Oct 7, 2025
| }); | ||
| }); | ||
|
|
||
| if (process.platform !== 'win32') { |
Member
Author
There was a problem hiding this comment.
Kinda cowboyish way to avoid running this test on Windows. cmd.exe doesn't have its Ctrl+D equivalent and even if sh.exe is installed, it doesn't seem to work the same way on Windows.
Contributor
There was a problem hiding this comment.
Kinda cowboyish way to avoid running this test on Windows
Yeah, looks like there's no cleaner way to skip a test conditionally.
avatus
approved these changes
Oct 7, 2025
gzdunek
approved these changes
Oct 13, 2025
e74eb74 to
245d22a
Compare
Contributor
|
@ravicious See the table below for backport results.
|
This was referenced Oct 14, 2025
Merged
Merged
mmcallister
pushed a commit
that referenced
this pull request
Nov 6, 2025
…o exit code (#59836) * Include the last input in the exit event * Close terminal tab if last input was Ctrl+D * Remove use of create functions
rhammonds-teleport
pushed a commit
that referenced
this pull request
Nov 6, 2025
…o exit code (#59836) * Include the last input in the exit event * Close terminal tab if last input was Ctrl+D * Remove use of create functions
mmcallister
pushed a commit
that referenced
this pull request
Nov 19, 2025
…o exit code (#59836) * Include the last input in the exit event * Close terminal tab if last input was Ctrl+D * Remove use of create functions
mmcallister
pushed a commit
that referenced
this pull request
Nov 20, 2025
…o exit code (#59836) * Include the last input in the exit event * Close terminal tab if last input was Ctrl+D * Remove use of create functions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #57232.
This is based on how VSCode solves this issue (see #57232 (comment)). We store the last input and always close the tab if the last input was Ctrl+D, even if the exit code was non-zero.
I tried to fix it in the Web UI too, but I didn't have enough time to figure out how terminal sessions work there. Connect controls the PTY process directly, whereas the Web UI depends on a stream from the proxy service, so I couldn't quite find its
onExitequivalent. There'sTermEvent.CLOSE, but there's alsoTermEvent.CONN_CLOSE.When backporting this PR to other branches, I'll not backport #59832, I'll just modify the protos under the old location.
changelog: Fixed an issue where Teleport Connect would not close a terminal tab when Ctrl+D was issued after a command with non-zero exit status