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
Allow extensions to access all terminals via API #13267
Reacted by Sergio Mattei, Jiri Spac, Keith Hill, Kaelin Laundry, Leo Caseiro, Ben Wildeman, Fabio Spampinato, Barrett Harber, Matt Sturgeon, Vasili Puchko and 13 more
Not yet sold on the importance and future-proof of that API. I would suggest to hold back with this API until the discussion about moving terminals into the editor space comes to an result (we recently talked about that in a UX sync). Then we might have a different set of requirements and limitations.
I was at one of those meetings that talked about that and it was shot down pretty hard, it would make management of terminals much more difficult and blur the lines between a panel and an editor. Would that really change the requirements though, this is just adding an open event and a list of terminals which would still be valid regardless of where a terminal was?
I am pretty sure the discussion will come again once we introduce horizontal editors. Not saying we merge panels and editors (errors, output, debug should stay there), but I have the (strong) feeling that terminal a much more like editors (I create/dispose them, I manage them) and for editors we have the far superior story for managing/navigating them. Like html-preview and extension-editors, terminal would greatly benefit from that IMO.
Taking about the API: It might not look any different but I just want to be careful and not rush into something we cannot change again. I don't see strong feature pressure for this so I would wait for the bigger workbench UX changes to land first.
This may be necessary to scan the output of a gulp watch (or similar) command on any terminal and using co-processes (#13337) to send errors to the problems panel. /cc Dirk Bäumer (@dbaeumer)
Johannes Rieken (@jrieken) for the problems use case you would want to watch the output of terminals in the background. When working on VS Code for example I have 2 terminals; gulp watch (typically background) and ./scripts/*.sh (foreground).
Dirk Bäumer (@dbaeumer) is this right? You would want to watch any terminal, not just ones that were launched via an extension?
I would like to watch the output of potential all terminals. However for the input I only need the active one. The user can only type in one terminal anyways.
We would love to see something like this for the PowerShell extension if it allowed us to bypass that initial, useless terminal startup. We now have an "integrated console" that effectively replaces the Debug Console at debug time and provides a REPL experience at edit time. That is, our integrated console allows the user to play around in the same PowerShell process that hosts both the language and debug services. This gives a nice SmallTalk-like REPL experience that spans edit & debug.
The only way to plumb this in was to add another terminal type - PowerShell Integrated Console. Unfortunately when VSCode first starts, it loads up the default terminal first before we get a chance to start our integrated console.
cc David Wilson (@daviwil)
Any chance we could see what shell exe the terminal launched? I know it's a bit of a grey area, but might be nice for determining whether I should kill one of the terminals in favor of the PowerShell Integrated Console.
David Wilson (@daviwil) the usage of it would probably be pretty limited, if you're just tracking the initial panel restore you could probably get around it some other way. I'm extra hesitant to add since it could be misleading, say if someone opens cmd inside powershell.
Hi, I'm facing a situation where I 'll need to create one terminal for every root folder (selected project) because the commands I'm registering need to run in its own root folder terminal. But I would like to create the terminal only once, but don't know how to retrieve an already created one.
any tip?
their kill command currently runs workbench.action.terminal.kill 25 times
Exactly, other than being pretty ugly and most of the times inefficient there are no guarantees this will even work (maybe the user has 26+ terminals open for some reason).
A few more things that could be done with access to all terminals:
Merge all terminals in a single pane, or move each terminal to its own pane, taking advantage of the new split terminals feature.
Terminals could auto-create a basic configuration based on your active terminals.
The proposed APIs look as future proof as they can possibly be to me.
This is landing in tomorrow's insiders as a proposed API:
exportnamespacewindow{/** * The currently active terminals or an empty array. * * @readonly */exportletterminals: Terminal[];/** * An [event](#Event) which fires when a terminal has been created, either through the * [createTerminal](#window.createTerminal) API or commands. */exportconstonDidOpenTerminal: Event<Terminal>;}
Activity
Tyriar commentedon Oct 5, 2016
What do you think Johannes Rieken (@jrieken)?
jrieken commentedon Oct 6, 2016
Not yet sold on the importance and future-proof of that API. I would suggest to hold back with this API until the discussion about moving terminals into the editor space comes to an result (we recently talked about that in a UX sync). Then we might have a different set of requirements and limitations.
Tyriar commentedon Oct 6, 2016
I was at one of those meetings that talked about that and it was shot down pretty hard, it would make management of terminals much more difficult and blur the lines between a panel and an editor. Would that really change the requirements though, this is just adding an open event and a list of terminals which would still be valid regardless of where a terminal was?
jrieken commentedon Oct 7, 2016
I am pretty sure the discussion will come again once we introduce horizontal editors. Not saying we merge panels and editors (errors, output, debug should stay there), but I have the (strong) feeling that terminal a much more like editors (I create/dispose them, I manage them) and for editors we have the far superior story for managing/navigating them. Like html-preview and extension-editors, terminal would greatly benefit from that IMO.
Taking about the API: It might not look any different but I just want to be careful and not rush into something we cannot change again. I don't see strong feature pressure for this so I would wait for the bigger workbench UX changes to land first.
Tyriar commentedon Nov 16, 2016
This may be necessary to scan the output of a
gulp watch(or similar) command on any terminal and using co-processes (#13337) to send errors to the problems panel. /cc Dirk Bäumer (@dbaeumer)jrieken commentedon Nov 17, 2016
Wouldn't
activeTerminalandonDidChangeActiveTerminalAPIs be better for spying on them?Tyriar commentedon Nov 17, 2016
Johannes Rieken (@jrieken) for the problems use case you would want to watch the output of terminals in the background. When working on VS Code for example I have 2 terminals;
gulp watch(typically background) and./scripts/*.sh(foreground).Dirk Bäumer (@dbaeumer) is this right? You would want to watch any terminal, not just ones that were launched via an extension?
dbaeumer commentedon Nov 18, 2016
I would like to watch the output of potential all terminals. However for the input I only need the active one. The user can only type in one terminal anyways.
rkeithhill commentedon Mar 23, 2017
Johannes Rieken (@jrieken) For an example of how the current behavior is sub-optimal see PowerShell/vscode-powershell#604
We would love to see something like this for the PowerShell extension if it allowed us to bypass that initial, useless terminal startup. We now have an "integrated console" that effectively replaces the Debug Console at debug time and provides a REPL experience at edit time. That is, our integrated console allows the user to play around in the same PowerShell process that hosts both the language and debug services. This gives a nice SmallTalk-like REPL experience that spans edit & debug.
The only way to plumb this in was to add another terminal type -
PowerShell Integrated Console. Unfortunately when VSCode first starts, it loads up the default terminal first before we get a chance to start our integrated console.cc David Wilson (@daviwil)
daviwil commentedon Apr 21, 2017
Any chance we could see what shell exe the terminal launched? I know it's a bit of a grey area, but might be nice for determining whether I should kill one of the terminals in favor of the PowerShell Integrated Console.
Tyriar commentedon Apr 24, 2017
David Wilson (@daviwil) the usage of it would probably be pretty limited, if you're just tracking the initial panel restore you could probably get around it some other way. I'm extra hesitant to add since it could be misleading, say if someone opens cmd inside powershell.
daviwil commentedon Apr 24, 2017
Sounds good, I definitely understand not wanting to add something of limited value!
cvgaviao commentedon Dec 15, 2017
Hi, I'm facing a situation where I 'll need to create one terminal for every root folder (selected project) because the commands I'm registering need to run in its own root folder terminal. But I would like to create the terminal only once, but don't know how to retrieve an already created one.
any tip?
handletastic commentedon Feb 27, 2018
Has there been any updates as off 2018?
Tyriar commentedon Feb 27, 2018
@hdsantos89 nothing other than more interest in getting at the PID of all terminals in #42521
Tyriar commentedon Mar 9, 2018
To give a summary of the needs for this API:
workbench.action.terminal.kill25 times) /cc Fabio Spampinato (@fabiospampinato)Let me know if I missed anything
fabiospampinato commentedon Mar 9, 2018
Exactly, other than being pretty ugly and most of the times inefficient there are no guarantees this will even work (maybe the user has 26+ terminals open for some reason).
A few more things that could be done with access to all terminals:
The proposed APIs look as future proof as they can possibly be to me.
Tyriar commentedon Apr 5, 2018
This is needed for #46192
Tyriar commentedon Apr 12, 2018
This is landing in tomorrow's insiders as a proposed API: