Skip to content

ITerminalInstance.reuseTerminal only works if terminal is still running #18661

Closed

Description

I would like to reuse a terminal instance where the shell / executable has already finished. To make this happen I would like to pass an argument to the createInstance via the IShellLaunchConfig that allows the following values. The new property would replace the current waitOnExit. It could be named 'onExit' and accept the following enum values: wait: would be the same as waitOnExit: true, close: would be the same as waitOnExit: false, keep: would keep the terminal instance alive. If reuseTerminal is call a new shell / pty process is start if non is running.

Activity

  1. added
    terminal
    on Jan 17, 2017
  2. Tyriar commented on Jan 17, 2017

    @Tyriar
    Contributor

    So you want waitOnExit without the key press to exit part? Is that the only issue with reuseTerminal right now?

  3. dbaeumer commented on Jan 17, 2017

    @dbaeumer
    MemberAuthor

    No, I want to keep the part without anything running in it. Consider a build task that is non watching and the user triggers build from time to time. I would like to collect the output from every build run in the same terminal pane although they are different pty processes. The reason is that I think that there is no way to find out whether a terminal is idle (there is a prompt in the command accepting user input). So I start the shell with /c so that it exits when the build command is finish.

  4. Tyriar commented on Jan 17, 2017

    @Tyriar
    Contributor

    Dirk Bäumer (@dbaeumer) yes, but would it be ideal for the key press to exit to be visible even when the terminal is being reused.

    For example:

    $ some task
    ...
    ...
    Press and key to close terminal
    

    Start another task ("Press any key to close terminal" line is cleared before launch):

    $ some task
    ...
    ...
    
    $ some other task
    ...
    ...
    Press and key to close terminal
    

    Alternatively:

    $ some task
    ...
    ...
    

    Start another task ("Press any key to close terminal" line is cleared before launch):

    $ some task
    ...
    ...
    
    $ some other task
    ...
    ...
    

    I suspect both might be useful to extension authors but if you're not interested in the first case, maybe I should just get rid of the press any key to close thing all together?

  5. dbaeumer commented on Jan 18, 2017

    @dbaeumer
    MemberAuthor

    Daniel Imms (@Tyriar) actually both would work. Showing the Press any key to close the terminal is something I would like to show/see if I have to read what is in the terminal. A kind of reminder. This is why I would like to have for the reuse case the alternative approach you outlined.

  6. Tyriar commented on Mar 1, 2017

    @Tyriar
    Contributor

    No longer needed, closing off.

  7. removed this from the March 2017 milestone on Mar 1, 2017
  8. locked and limited conversation to collaborators on Nov 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

terminal

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions