Skip to content

Suggestion: Allow line selection in terminal #46761

Closed

Description

@chrisdias

testing #46594

Suggestion: Allow selecting a line at a time while navigating in terminal line by line.

With #46594 I can use CMD+UpArrow CMD+DownArrow to navigate, and can press Shift+CMD+UpArrow and Shift+CMD+DownArrow to select a block of text in the terminal (between commands). This is cool for selecting blocks of text that are the output of a command.

But, what if I want to select a single line at a time? Since I can use CMD+ALT+PageUp and CMD+ALT+PageDown to navigate line by line in the terminal, perhaps Shift+CMD+ALT+PageUp and Shift+CMD+ALT+PageDown could be used for that.

Activity

  1. added
    terminal
    on Mar 27, 2018
  2. added
    feature-request
    help wanted
    on Mar 28, 2018
  3. Tyriar commented on Mar 28, 2018

    @Tyriar
    Contributor

    Opening to PRs, this will involve adding 2 new commands terminal.integrated.selectToNextLine/selectToPreviousLine and handling it within TerminalCommandTracker.

  4. added this to the Backlog milestone on Mar 28, 2018
  5. ddruker commented on Apr 7, 2018

    @ddruker
    Contributor

    Daniel Imms (@Tyriar) Mind if I tackle this? I was just in the integrated terminal code so this code be a good issue for me.

  6. Tyriar commented on Apr 8, 2018

    @Tyriar
    Contributor

    David (@ddruker) sure! This will probably involve having some additional state in TerminalCommandTracker to tell whether it's a command or a line focused.

    https://github.com/Microsoft/vscode/blob/3fbfccad359e278a4fbde106328b2b8e2e2242a7/src/vs/workbench/parts/terminal/node/terminalCommandTracker.ts#L25-L26

    We probably want to create a new marker whenever the line is changed (if the previous line is not a command), if we just track it with a number it might be invalid when lines are trimmed off the top of the terminal.

  7. ddruker commented on Apr 8, 2018

    @ddruker
    Contributor

    Daniel Imms (@Tyriar) I'm assuming this would only be previous line selection and only one line can be selected at a time using the proposed commands. Does that sound right?

    Also, would the UX be similar to line by line navigation, where the terminal window always scrolls? For example, the terminal window does not need to scroll unless the line is out of view.

  8. Tyriar commented on Apr 9, 2018

    @Tyriar
    Contributor

    I'm assuming this would only be previous line selection and only one line can be selected at a time using the proposed commands. Does that sound right?

    Next should be added as well to mirror the existing commands. Users could for example go one line too far and want to go back.

    Also, would the UX be similar to line by line navigation, where the terminal window always scrolls? For example, the terminal window does not need to scroll unless the line is out of view.

    David (@ddruker) for the selectTo* commands, the 'focused' line is always in the middle of the viewport.

  9. ddruker commented on Apr 10, 2018

    @ddruker
    Contributor
  10. Tyriar commented on May 19, 2018

    @Tyriar
    Contributor

    Commands added in #47991

  11. added
    verification-needed
    on May 19, 2018
  12. isidorn commented on May 29, 2018

    @isidorn

    Select to previous line works great.
    However I was not able to get anything useful from the select to next line since I always have the last line focused in my terminal. Even if I select some text in the middle of the terminal select to next
    line simply jumps back to last line. What am I missing here?

  13. Tyriar commented on May 29, 2018

    @Tyriar
    Contributor

    Isidor Nikolic (@isidorn) select next command/line need to be used after select previous command/line.

  14. isidorn commented on May 29, 2018

    @isidorn

    Daniel Imms (@Tyriar) ok, adding verified even though I find it a bit unintuitive.
    I would expect that the select next line would work even if I have 3 lines manualy selected.

  15. locked and limited conversation to collaborators on Jul 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

feature-requesthelp wantedterminalverification-neededverified

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions