Skip to content

Proposal TerminalExitStatus.reason - #152833

Merged
Daniel Imms (Tyriar) merged 11 commits into
microsoft:mainfrom
jeanp413:proposal-130231
Jul 11, 2022
Merged

Proposal TerminalExitStatus.reason#152833
Daniel Imms (Tyriar) merged 11 commits into
microsoft:mainfrom
jeanp413:proposal-130231

Conversation

@jeanp413

Copy link
Copy Markdown
Contributor

This PR fixes #130231

Implements API proposal TerminalExitStatus.reason to address issue #130231
Added Shutdown(main motivation for #130231) and Unknown(i.e. any other reasons) reasons

Side note, after working on this, I would say that firing vscode.window.onDidCloseTerminal on shutdown is more of a bug than a feature, if some extension terminal logic is required to execute on shutdown then using context.subscriptions would be preferred I think but changing onDidCloseTerminal behavior would be a breaking change 🤔

cc Daniel Imms (@Tyriar)

* get cut off. If immediate kill any terminal processes immediately.
* @param isShutdown Whether the kill was triggered by lifecycle shutdown
*/
dispose(immediate?: boolean): void;

@jeanp413 Jean Pierre (jeanp413) Jun 22, 2022

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Is immediate deprecated? There was only one place that used it (in terminalQuickAccess.ts) but I changed it to terminalService.safeDisposeTerminal so it's the same as other calls.
If not I'll revet this change.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm not totally sure what the current state of this is, but it was always a bit of a hack to add a param to dispose like this so I'd want to move away from it if we were to change things in this area.

@akosyakov

Copy link
Copy Markdown
Contributor

Daniel Imms (@Tyriar) Does proposed change make sense to you? We would really appreciate such API like stable though to unblock our customers. 🙏

@Tyriar Daniel Imms (Tyriar) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The idea seems reasonable, I'll make a note to bring this to the next API sync which will be in 2 weeks.

Comment thread src/vscode-dts/vscode.proposed.terminalExitReason.d.ts
* get cut off. If immediate kill any terminal processes immediately.
* @param isShutdown Whether the kill was triggered by lifecycle shutdown
*/
dispose(immediate?: boolean): void;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm not totally sure what the current state of this is, but it was always a bit of a hack to add a param to dispose like this so I'd want to move away from it if we were to change things in this area.

@akosyakov

Copy link
Copy Markdown
Contributor

Daniel Imms (@Tyriar) thank you! Is API sync internal or we can follow it somehow as well?

@meganrogge

Copy link
Copy Markdown
Collaborator

Anton Kosyakov (@akosyakov) it is internal and we will post a summary after that happens

Comment thread src/vscode-dts/vscode.proposed.terminalExitReason.d.ts Outdated
@meganrogge

Copy link
Copy Markdown
Collaborator

Discussed at the API sync and we think the shape looks good. Just the one question above

Comment thread src/vs/workbench/contrib/terminal/browser/terminalInstance.ts Outdated
Comment thread src/vs/workbench/contrib/terminal/browser/terminalInstance.ts
Co-authored-by: Daniel Imms <2193314+Tyriar@users.noreply.github.com>
@jeanp413

Jean Pierre (jeanp413) commented Jul 8, 2022

Copy link
Copy Markdown
Contributor Author

I forgot to ask this, how long does it take for a proposal API to become stable? I just realized that even if this is merged we won't be able to use it in our extension and publish it to the marketplace 😅

@Tyriar

Copy link
Copy Markdown
Contributor

It needs to stay proposed for at least a month, this one's not complex so 1 month seems right

@akosyakov

Anton Kosyakov (akosyakov) commented Jul 11, 2022

Copy link
Copy Markdown
Contributor

Discussed at the API sync and we think the shape looks good. Just the one question above

Daniel Imms (@Tyriar) Megan Rogge (@meganrogge) Thank you a lot 🙏 Is it good to land? I believe Jean Pierre (@jeanp413) addressed the feedback.

@Tyriar Daniel Imms (Tyriar) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good, will merge after a full test pass

@Tyriar
Daniel Imms (Tyriar) dismissed stale reviews from Logan Ramos (lramos15) and themself via fcbef68 July 11, 2022 14:48
@Tyriar
Daniel Imms (Tyriar) merged commit 678e59a into microsoft:main Jul 11, 2022
@jeanp413
Jean Pierre (jeanp413) deleted the proposal-130231 branch July 11, 2022 15:09
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 26, 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.

expose pty terminal api to detect when it is explicitly killed by a user

5 participants