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

Expose a terminal API option to pause when the shell is exited #15583

Closed
Tyriar opened this issue Nov 16, 2016 · 9 comments · Fixed by #18336
Closed

Expose a terminal API option to pause when the shell is exited #15583

Tyriar opened this issue Nov 16, 2016 · 9 comments · Fixed by #18336
Assignees
Labels
api feature-request Request for new features or functionality terminal General terminal issues that don't fall under another label

Comments

@Tyriar
Copy link
Member

Tyriar commented Nov 16, 2016

This is a requirement for the tasks framework to be moved to using the integrated terminal. The idea is to allow extensions to optionally specify they don't want the terminal to go away immediately after the shell process is exited but instead wait for input.

This would allow the tasks framework (and other extensions) to run a command that exits the shell immediately afterwards, and then wait for a keystroke or for the terminal to be killed manually, for example:

gulp build
...
...

Press and key to close the terminal...

Proposed API:

export function createTerminal(name?: string, shellPath?: string, shellArgs?: string[], waitOnExit?: boolean): Terminal;

/cc @jrieken @dbaeumer

@Tyriar Tyriar added api feature-request Request for new features or functionality terminal General terminal issues that don't fall under another label labels Nov 16, 2016
@Tyriar Tyriar added this to the January 2017 milestone Nov 16, 2016
@Tyriar Tyriar self-assigned this Nov 16, 2016
@jrieken
Copy link
Member

jrieken commented Nov 17, 2016

We might have reached a point where it makes sense to talk about a second overload with an options bag. Like

export function createTerminal(name?: string, shellPath?: string, shellArgs?: string[]): Terminal;

export function createTerminal(options: {name?: string; shellPath?: string; shellArgs?: string[]; waitOnExit?: boolean }): Terminal;

@Tyriar
Copy link
Member Author

Tyriar commented Jan 4, 2017

Upstream issue to implement disableStdin (prereq) xtermjs/xterm.js#452 (PR xtermjs/xterm.js#453)

@Tyriar
Copy link
Member Author

Tyriar commented Jan 9, 2017

Upstream PR is merged in

Tyriar added a commit that referenced this issue Jan 9, 2017
This brings in disableStdio option (Part of #15583)
Tyriar added a commit that referenced this issue Jan 9, 2017
@Tyriar
Copy link
Member Author

Tyriar commented Jan 9, 2017

PR that exposes the new waitOnExit option to API: #18336
Example usage: microsoft/vscode-extension-samples@9b46d6b

@Tyriar
Copy link
Member Author

Tyriar commented Jan 9, 2017

@dbaeumer FYI currently if a waitOnExit shell exits with a non-0 code I print the message that would normally go in the message box inside the terminal:

image

@Tyriar Tyriar reopened this Jan 23, 2017
Tyriar added a commit that referenced this issue Jan 23, 2017
This may turn into an enum or change behavior soon pending on the result of
task-terminal integration. Removing from the API until more thought has been
put into it.

Part of #15583
Part of #18661
@Tyriar
Copy link
Member Author

Tyriar commented Jan 23, 2017

FYI @dbaeumer @jrieken I've pulled the waitOnExit option out of the API for now as it might become an enum (see #18661). I've left TerminalOptions in as it will come later anyhow.

@Tyriar Tyriar modified the milestones: February 2017, January 2017 Jan 23, 2017
@Tyriar Tyriar modified the milestones: February 2017, March 2017 Feb 21, 2017
@Tyriar
Copy link
Member Author

Tyriar commented Mar 1, 2017

No longer needed (yet), closing off.

@Tyriar Tyriar closed this as completed Mar 1, 2017
@jrieken
Copy link
Member

jrieken commented Mar 1, 2017

I hope we still have use for TerminalOptions... We need more options ;-)

@Tyriar
Copy link
Member Author

Tyriar commented Mar 1, 2017

@jrieken the hope is still to move tasks to an extension, it's not the priority now though. A lot of the stuff that tasks need would be great for extensions to be able to hook into eventually as well, now we're just not rushed in pushing the APIs out. Some things that I can see us adding soon:

  • A more focused waitOnExit after we've received more feedback from tasks
  • Ability to set the terminal environment

@Tyriar Tyriar removed this from the March 2017 milestone Mar 24, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api feature-request Request for new features or functionality terminal General terminal issues that don't fall under another label
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants