Skip to content

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

Closed

Description

@Tyriar

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 Johannes Rieken (@jrieken) Dirk Bäumer (@dbaeumer)

Activity

  1. added
    feature-request
    terminal
    on Nov 16, 2016
  2. jrieken commented on Nov 17, 2016

    @jrieken
    Contributor

    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;
  3. Tyriar commented on Jan 4, 2017

    @Tyriar
    ContributorAuthor

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

  4. Tyriar commented on Jan 9, 2017

    @Tyriar
    ContributorAuthor

    Upstream PR is merged in

  5. Tyriar commented on Jan 9, 2017

    @Tyriar
    ContributorAuthor

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

  6. Tyriar commented on Jan 9, 2017

    @Tyriar
    ContributorAuthor

    Dirk Bäumer (@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

  7. Tyriar commented on Jan 23, 2017

    @Tyriar
    ContributorAuthor

    FYI Dirk Bäumer (@dbaeumer) Johannes Rieken (@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.

  8. Tyriar commented on Mar 1, 2017

    @Tyriar
    ContributorAuthor

    No longer needed (yet), closing off.

  9. jrieken commented on Mar 1, 2017

    @jrieken
    Contributor

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

  10. Tyriar commented on Mar 1, 2017

    @Tyriar
    ContributorAuthor

    Johannes Rieken (@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
  11. removed this from the March 2017 milestone on Mar 24, 2017
  12. locked and limited conversation to collaborators on Nov 18, 2017
  13. added a commit that references this issue on Sep 6, 2026
    650b730
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

apifeature-requestterminal

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions