You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Terminal should throw an event when a terminal has completed (and is waiting to close) #18376
dir is an example here and '/C' is currently specific to cmd.exe.
What I would like to see happening here is that the cmd.exe is started, dir is executed and then cmd.exe terminates. When cmd.exe terminates I would like to get an event.
Regarding the '/C' option: any change to have this abstracted in the terminal itself. Having that knowledge on the client side is not very nice.
I changed it to this.terminalService.createInstance(Task: ${task.name}, 'C:\\WINDOWS\\system32\\cmd.exe', ['/C', this.configuration.command], false); after some debugging but now no terminal shows up at all. I get an exception messageService.ts:126 write EPIPE
Did you call Terminal.show() immediately after? API terminals are launched in the background. You could try point to C:\\Windows\\sysnative\\cmd.exe and/or use an environment var to find C:\\Windows. Sysnative is a weird symlink thing that points to system32 or syswow64. Try that first and maybe rm -rf node_modules/node-pty node_modules/pty.js and try reinstall deps?
It would be good to encapsulate the bash and cmd command execution commands inside the TerminalService, however I'm not sure something like that should be exposed in the Terminal API. In general I don't want to encourage using a custom shell/args unless the specific use case calls for it (like tasks).
It would be good to encapsulate the bash and cmd command execution commands inside the TerminalService, however I'm not sure something like that should be exposed in the Terminal API. In general I don't want to encourage using a custom shell/args unless the specific use case calls for it (like tasks).
As said we keep the task framework in the core for now. So it would allow us to experiment with some API here before thinking about making it official.
Dirk Bäumer (@dbaeumer) I guess I'll expose some event on ITerminalInstance exit for now which when used with waitOnExit to allow reuse of the terminal (via another ITerminalInstance call to start up a new process while retaining the old output).
changed the title [-]Terminal API should throw an event when a terminal has completed (and is waiting to close)[/-][+]Terminal should throw an event when a terminal has completed (and is waiting to close)[/+]on Jan 11, 2017
Activity
dbaeumer commentedon Jan 11, 2017
What I actually want to do is the following:
diris an example here and '/C' is currently specific to cmd.exe.What I would like to see happening here is that the cmd.exe is started, dir is executed and then cmd.exe terminates. When cmd.exe terminates I would like to get an event.
Regarding the '/C' option: any change to have this abstracted in the terminal itself. Having that knowledge on the client side is not very nice.
dbaeumer commentedon Jan 11, 2017
What currently happens is the following:
dbaeumer commentedon Jan 11, 2017
I changed it to
this.terminalService.createInstance(Task: ${task.name}, 'C:\\WINDOWS\\system32\\cmd.exe', ['/C', this.configuration.command], false);after some debugging but now no terminal shows up at all. I get an exceptionmessageService.ts:126 write EPIPETyriar commentedon Jan 11, 2017
Did you call
Terminal.show()immediately after? API terminals are launched in the background. You could try point toC:\\Windows\\sysnative\\cmd.exeand/or use an environment var to findC:\\Windows.Sysnativeis a weird symlink thing that points tosystem32orsyswow64. Try that first and mayberm -rf node_modules/node-pty node_modules/pty.jsand try reinstall deps?It would be good to encapsulate the bash and cmd command execution commands inside the TerminalService, however I'm not sure something like that should be exposed in the Terminal API. In general I don't want to encourage using a custom shell/args unless the specific use case calls for it (like tasks).
dbaeumer commentedon Jan 11, 2017
I got it working passing in true to
waitOnExit. My code looks like this now:What I actually would like to have is a listener instead of the waitOnExit. But we already discussed this. Any advice on how to improve this?
dbaeumer commentedon Jan 11, 2017
Regarding:
As said we keep the task framework in the core for now. So it would allow us to experiment with some API here before thinking about making it official.
Tyriar commentedon Jan 11, 2017
Dirk Bäumer (@dbaeumer) I guess I'll expose some event on
ITerminalInstanceexit for now which when used withwaitOnExitto allow reuse of the terminal (via anotherITerminalInstancecall to start up a new process while retaining the old output).[-]Terminal API should throw an event when a terminal has completed (and is waiting to close)[/-][+]Terminal should throw an event when a terminal has completed (and is waiting to close)[/+]Tyriar commentedon Jan 11, 2017
I closed this as it's possible internally now via
ITerminalInstance.onExithilleer commentedon Nov 16, 2017
Can you help me on how I get the state of the terminal - e.g. it finished running whatever command? I can't find any help in the documentation.
Add ITerminalInstance.onExit internal API