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

vscode: support Terminal#exitStatus #11175

Merged
merged 5 commits into from
May 25, 2022
Merged

Conversation

educphi
Copy link
Contributor

@educphi educphi commented May 18, 2022

What it does

Fixes #11139 by adding support for Terminal#exitStatus. This field is set with the TerminalExitStatus object when the terminal it is referring to is closed, and contains the exit code of its process, if one was provided when terminating.

How to test

@vince-fugnitto created a small extension to test this new feature : term-exit-0.0.1.zip
You can fin the source code for this extension on this repository

  1. download and include the term-exit-0.0.1.zip test extension
  2. build and start the application
  3. open a terminal
  4. run the command exit <code> in the open terminal. <code> must be an integer between 0 and 255, and will default to 0 if not provided.
  5. terminal should close and extension will display its exit code, as shown in the picture below.
Test example

image

Review checklist

Reminder for reviewers

Signed-off-by: Philippe Ducas philippe.ducas@ericsson.com

@vince-fugnitto vince-fugnitto added terminal issues related to the terminal vscode issues related to VSCode compatibility labels May 19, 2022
@alvsan09 alvsan09 self-requested a review May 20, 2022 12:39
Copy link
Contributor

@alvsan09 alvsan09 left a comment

Choose a reason for hiding this comment

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

I have tested the change using the provided plugin and it works fine 👍

The code looks good to me, I left a suggestion in inline comments.

One more observation is that you are using the master branch of your fork to trigger the PR,
It's best to create a feature branch containing your changes, you will be able to then work on multiple issues in parallel.

packages/plugin/src/theia.d.ts Show resolved Hide resolved
Copy link
Member

@msujew msujew left a comment

Choose a reason for hiding this comment

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

I'm happy with the changes 👍

  • Closing the terminal widget manually leads to an undefined exit code
  • If the terminal exits with an error code, it is correctly propagated to the plugin host
  • Reloading the browser window does not trigger the terminal closed event.

Signed-off-by: Philippe Ducas <philippe.ducas@ericsson.com>
Signed-off-by: Philippe Ducas <philippe.ducas@ericsson.com>
Signed-off-by: Philippe Ducas <philippe.ducas@ericsson.ca>
@vince-fugnitto vince-fugnitto merged commit f2bdd95 into eclipse-theia:master May 25, 2022
@vince-fugnitto vince-fugnitto added this to the 1.26.0 milestone May 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
terminal issues related to the terminal vscode issues related to VSCode compatibility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[vscode] Support Terminal#exitStatus
5 participants