-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check if binary exists before passing it to node-pty #44440
Conversation
// start, it's reported through PtyProcess.prototype.onStartError. Similarly, the information | ||
// about a successful start is also conveyed through an emitted event rather than the method | ||
// returning with no error. Hence why we can ignore what this promise returns. | ||
void this.ptyProcess.start(event.columns, event.rows).then(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm using the syntax recommended by no-floating-promises to explicitly mark a promise that we ignore. https://typescript-eslint.io/rules/no-floating-promises/#ignorevoid
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
@@ -30,6 +30,7 @@ | |||
"split2": "4.2.0", | |||
"strip-ansi": "^7.1.0", | |||
"tar-fs": "^3.0.6", | |||
"which": "^4.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know it's a small package, but maybe we could add @types/which
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, mostly to check out the flow of adding a new package with pnpm. ;)
bc185d7
to
ad7d66f
Compare
@ravicious See the table below for backport results.
|
Fixes #44385.
At some point between 0.11.0-beta29 to 1.1.0-beta5, node-pty stopped throwing errors on Linux and macOS if the command to execute doesn't exist (microsoft/node-pty#689). Instead, the PTY simply exits with error code 1.
This PR makes it so that we manually run the equivalent of Go's
os/exec.LookPath
before starting a terminal session. This way we can bubble up the error about a nonexistent command to the UI.changelog: Fixed terminal sessions with a database CLI client in Teleport Connect hanging indefinitely if the client cannot be found