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

Improve terminal navigation #29879

Closed
kieferrm opened this issue Jun 29, 2017 · 8 comments
Closed

Improve terminal navigation #29879

kieferrm opened this issue Jun 29, 2017 · 8 comments
Assignees
Labels
feature-request Request for new features or functionality on-testplan terminal Integrated terminal issues
Milestone

Comments

@kieferrm
Copy link
Member

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.

@kieferrm kieferrm added feature-request Request for new features or functionality terminal Integrated terminal issues labels Jun 29, 2017
@kieferrm kieferrm added this to the June 2017 milestone Jun 29, 2017
@Tyriar
Copy link
Member

Tyriar commented 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:

1: /bin/bash
2: node
3: /bin/bash

On Windows:

1: powershell.exe
2: powershell.exe
3: powershell.exe

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.

Related: #20676

@Tyriar
Copy link
Member

Tyriar commented 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
Copy link
Member Author

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.

@kieferrm kieferrm removed this from the June 2017 milestone Jun 29, 2017
@Tyriar
Copy link
Member

Tyriar commented Jun 30, 2017

@kieferrm not sure we have buttons in the quick open right now, would this be a new concept?

@kieferrm
Copy link
Member Author

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
Copy link
Member

Tyriar commented 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
Copy link
Member Author

kieferrm commented 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
Copy link
Member

Fixed in #30968

@Tyriar Tyriar added this to the July 2017 milestone Jul 20, 2017
@Lixire Lixire mentioned this issue Jul 31, 2017
3 tasks
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality on-testplan terminal Integrated terminal issues
Projects
None yet
Development

No branches or pull requests

4 participants