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
Navigating to the right terminal for me is harder than it should be.
I can switch to the terminal panel easily, but from there I need to get to the right terminal. I can use shortcuts for that but they are "unstable" because they depend on the sequence in which I opened my terminals.
I can use Open View but it's suboptimal because it's a long list. Good thing is terminals have ids, so I can use it to filter the list quickly.
I'd like to get an Open Terminal command that opens a quick pick just for terminals. It should also be available as global command from Cmd+P? as terminal.
This should be relatively straightforward to implement, at least using the "title" information we expose at the moment. The problem is that the title information is not very descriptive currently as it shows the current program on Linux/macOS (eg. bash, node, python) on Windows it will only ever show the shell that the terminal was launched with, so unless you're using an extension such as https://marketplace.visualstudio.com/items?itemName=Tyriar.shell-launcher, it will only ever be "powershell.exe" for example (whatever the selected shell is).
So to clarify, on Linux/macOS you might get a list like this:
I can imagine this being a lot more useful when we improve the information attached to the terminal. Ideally this would contain something like "(program) (args) (cwd)". There is no event we can hook into for fetching the cwd, however on Linux/macOS we can use a trick with the lsof command to fetch the cwd:
# 12345 is the PID of the shell
lsof -p 12345 | grep cwd | tr -s ''| cut -d '' -f9-
I'm not sure if this works well with nested shells (launching zsh from bash), we would also need to call it sparingly and at the right times as we don't get an event.
For Windows, I'm not aware of how to get this information apart from scanning each line for a prompt with a regex which is bad for perf and not very reliable.
There is also the issue of finding a keybinding for this, the reason there aren't keybindings for most of the terminal commands is because most good keybindings were already taken at the time they were added.
Being able to use the cwd would be a nice step forward. Another thought: We now have the Rename Terminal command. If we find a way to make this easier discoverable - maybe we could integrate it into this switcher itself - it would give users a way to work around the non-descriptive names.
As a first step, I was thinking about including the rename terminal action in the quick-pick list below a separator. That would make it easier discoverable.
We have to try it out what would work best. Since the issue we want to solve is that all terminals are named the same, showing a quick pick with terminal names that are all the same does not really help.
Activity
Tyriar commentedon Jun 29, 2017
This should be relatively straightforward to implement, at least using the "title" information we expose at the moment. The problem is that the title information is not very descriptive currently as it shows the current program on Linux/macOS (eg. bash, node, python) on Windows it will only ever show the shell that the terminal was launched with, so unless you're using an extension such as https://marketplace.visualstudio.com/items?itemName=Tyriar.shell-launcher, it will only ever be "powershell.exe" for example (whatever the selected shell is).
So to clarify, on Linux/macOS you might get a list like this:
On Windows:
I can imagine this being a lot more useful when we improve the information attached to the terminal. Ideally this would contain something like
"(program) (args) (cwd)". There is no event we can hook into for fetching the cwd, however on Linux/macOS we can use a trick with thelsofcommand to fetch the cwd:I'm not sure if this works well with nested shells (launching zsh from bash), we would also need to call it sparingly and at the right times as we don't get an event.
For Windows, I'm not aware of how to get this information apart from scanning each line for a prompt with a regex which is bad for perf and not very reliable.
Related: #20676
Tyriar commentedon Jun 29, 2017
There is also the issue of finding a keybinding for this, the reason there aren't keybindings for most of the terminal commands is because most good keybindings were already taken at the time they were added.
kieferrm commentedon Jun 29, 2017
Being able to use the cwd would be a nice step forward. Another thought: We now have the
Rename Terminalcommand. If we find a way to make this easier discoverable - maybe we could integrate it into this switcher itself - it would give users a way to work around the non-descriptive names.Tyriar commentedon Jun 30, 2017
Kai Maetzel (@kieferrm) not sure we have buttons in the quick open right now, would this be a new concept?
kieferrm commentedon Jun 30, 2017
As a first step, I was thinking about including the rename terminal action in the quick-pick list below a separator. That would make it easier discoverable.
Tyriar commentedon Jun 30, 2017
Ah OK. Currently it renamed the current terminal, do you think it should launch it's own quick pick as well?
kieferrm commentedon Jun 30, 2017
We have to try it out what would work best. Since the issue we want to solve is that all terminals are named the same, showing a quick pick with terminal names that are all the same does not really help.
roblourens commentedon Jul 20, 2017
Fixed in #30968