Skip to content

Improve terminal navigation #29879

Closed
Closed

Description

@kieferrm

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.

Activity

  1. added
    feature-requestRequest for new features or functionality
    terminalGeneral terminal issues that don't fall under another label
    on Jun 29, 2017
  2. Tyriar commented on Jun 29, 2017

    @Tyriar
    Contributor

    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

  3. Tyriar commented on Jun 29, 2017

    @Tyriar
    Contributor

    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.

  4. kieferrm commented on Jun 29, 2017

    @kieferrm
    MemberAuthor

    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.

  5. removed this from the June 2017 milestone on Jun 29, 2017
  6. Tyriar commented on Jun 30, 2017

    @Tyriar
    Contributor

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

  7. kieferrm commented on Jun 30, 2017

    @kieferrm
    MemberAuthor

    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.

  8. Tyriar commented on Jun 30, 2017

    @Tyriar
    Contributor

    Ah OK. Currently it renamed the current terminal, do you think it should launch it's own quick pick as well?

  9. kieferrm commented on Jun 30, 2017

    @kieferrm
    MemberAuthor

    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.

  10. roblourens commented on Jul 20, 2017

    @roblourens
    Member

    Fixed in #30968

  11. locked and limited conversation to collaborators on Nov 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

feature-requestRequest for new features or functionalityon-testplanterminalGeneral terminal issues that don't fall under another label

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions