Skip to content
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

Task terminals with a failed process task aren't always reused properly #141939

Merged
merged 3 commits into from
Feb 3, 2022

Conversation

alexr00
Copy link
Member

@alexr00 alexr00 commented Feb 1, 2022

Fixes #141728

@alexr00 alexr00 self-assigned this Feb 1, 2022
@alexr00 alexr00 requested a review from Tyriar February 1, 2022 12:52
@alexr00 alexr00 added this to the February 2022 milestone Feb 1, 2022
@@ -1412,7 +1412,7 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
}

// First onExit to consumers, this can happen after the terminal has already been disposed.
this._onExit.fire(this._exitCode);
this._onExit.fire(parsedExitResult);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The introduction of null seems pretty confusing, could this instead fire exitCodeOrError which would let you check message directly? If exitCodeOrError is an ITerminalLaunchError then the terminal failed before the process launched which is the case you're after.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The message is localized, so I'm not sure what I should check for there.

Checking if exitCodeOrError is an ITerminalLaunchError will work though. I didn't realize it would only be an ITerminalLaunchError when the terminal failed before the process launched.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

parsedExitResult is localized for the notification, exitCodeOrError.message isn't though.

@alexr00 alexr00 requested a review from Tyriar February 2, 2022 10:28
Copy link
Member

@Tyriar Tyriar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@alexr00
Copy link
Member Author

alexr00 commented Feb 3, 2022

Thanks for reviewing!

@alexr00 alexr00 merged commit 47fc3a1 into main Feb 3, 2022
@alexr00 alexr00 deleted the alexr00/issue141728 branch February 3, 2022 14:50
@github-actions github-actions bot locked and limited conversation to collaborators Mar 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Task terminals with a failed process task aren't always reused properly
2 participants