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

TerminalOptions.waitOnExit API #70444

Open
Tyriar opened this issue Mar 14, 2019 · 12 comments
Open

TerminalOptions.waitOnExit API #70444

Tyriar opened this issue Mar 14, 2019 · 12 comments
Assignees
Labels
api api-proposal feature-request Request for new features or functionality terminal Integrated terminal issues
Milestone

Comments

@Tyriar
Copy link
Member

Tyriar commented Mar 14, 2019

enum WaitOnExitType {
    Never = 0,
    NonZeroExitCode = 1,
    Always = 2
}

export interface TerminalOptions {
    /**
     * Whether the terminal panel should wait before closing when a terminal's process exits.
     */
    waitOnExit?: WaitOnExitType;
}

waitOnExit was originally proposed as a boolean in #15583

@Tyriar Tyriar added feature-request Request for new features or functionality api terminal Integrated terminal issues api-proposal labels Mar 14, 2019
@Tyriar Tyriar added this to the April 2019 milestone Mar 14, 2019
@Tyriar Tyriar self-assigned this Mar 14, 2019
@Eskibear
Copy link
Member

@Tyriar
Copy link
Member Author

Tyriar commented Mar 25, 2019

@Eskibear it was commented out because we were planning on moving tasks to an extension but ended up changing our minds. I'm interesting in what your use case is?

@Eskibear
Copy link
Member

I'm working to enable debugging plugin goal of a Maven project, leveraging Java Debugger extension. The workflow is:

  1. create a terminal with env MAVEN_OPTS injected, which specifies the listening port (a random free port).
  2. send the maven command to the terminal, then the command will run in debug mode.
  3. start a Java debug session, attach to the port.

After terminating the debug session, users may still want to re-visit the diagnostic info printed, so I want to i) persist the printed info there. But as the injected env will force all maven commands to run in debug mode, I also want to ii) prevent users from re-using the terminal.

@Tyriar
Copy link
Member Author

Tyriar commented Oct 9, 2019

No plans to add this as there is not enough need, for the maven case tasks might be a better option.

@Tyriar Tyriar added the *out-of-scope Posted issue is not in scope of VS Code label Oct 9, 2019
@vscodebot
Copy link

vscodebot bot commented Oct 9, 2019

This issue is being closed to keep the number of issues in our inbox on a manageable level, we are closing issues that are not going to be addressed in the foreseeable future: We look at the number of votes the issue has received and the number of duplicate issues filed. More details here. If you disagree and feel that this issue is crucial: We are happy to listen and to reconsider.

If you wonder what we are up to, please see our roadmap and issue reporting guidelines.

Thanks for your understanding and happy coding!

@vscodebot vscodebot bot closed this as completed Oct 9, 2019
@twadleigh
Copy link

One fairly general use for this functionality is to be able to see a stack trace or other diagnostics from a terminal process that crashes. That was the original motivation for referencing julia-vscode/julia-vscode#653.

@Tyriar
Copy link
Member Author

Tyriar commented Oct 10, 2019

@twadleigh can you describe a little more how Julia uses/launches the terminal? Is launching a Julia shell and sending text an alternative?

@twadleigh
Copy link

twadleigh commented Oct 10, 2019

@Tyriar you can see the way the julia-vscode extension launches the julia process in the terminal here.

Can you possibly describe more about what you mean by launching a shell and sending text? I initially proposed a solution that wrapped the julia process in a monitor process to intercept the crash, but it was rejected as too heavyweight.

@Tyriar
Copy link
Member Author

Tyriar commented Oct 11, 2019

@twadleigh Julia is a shell that can also run files right? My proposal was doing something like this:

const t = window.createTerminal({
  shellPath: 'julia.exe'
});
t.sendText('the file/code to run inside the shell');

After run it would leave a shell hanging though.

@Tyriar
Copy link
Member Author

Tyriar commented Sep 1, 2021

@pfitzseb
Copy link
Contributor

Any chance to restart the implementation of/discussion around this feature?

FWIW, what we want for the Julia extension matches the task-backed terminals very well -- the terminal lifecycle is decoupled from the underlying process and we get terminal recycling for free. Tasks feel like the wrong tool for the job though, and there are issues with e.g. Tasks: Rerun last task (even when the task isn't registered).

@m-hilgendorf
Copy link

Would also like to bump this FR - currently our workaround for the stanza REPL is to invoke it through a secondary launcher process which waits to exit on input.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api api-proposal feature-request Request for new features or functionality terminal Integrated terminal issues
Projects
None yet
Development

No branches or pull requests

6 participants