1

I just started using Bash shell from git-scm Windows as VSCode integrated terminal.

I'd like to select all text of current command using the hotkey I'm familiar with (Ctrl+A), can I configure the terminal for it?

GorvGoyl
  • 42,508
  • 29
  • 229
  • 225

1 Answers1

1

You can add a key binding for the command Terminal Select All and set a when condition of when the terminal is focused, so it doesn't interfere with other bindings:

Keybinding

JSON:

[
    {
        "key": "ctrl+a",
        "command": "workbench.action.terminal.selectAll",
        "when": "terminalFocus"
    }
]
Timothy G.
  • 6,335
  • 7
  • 30
  • 46
  • sorry I was not clear, i meant select all text of current command. in powershell we can do ctrl+a and it'll select the whole text for the current command https://i.imgur.com/1uu7WEi.png – GorvGoyl Aug 30 '21 at 15:20
  • @GorvGoyl after playing around, there doesn't seem to be a way from VS Code. Powershell must have it's own implementation of what CTRL + A does that doesn't seem configurable from VS Code for a git-bash terminal, or from git-bash in general. – Timothy G. Aug 30 '21 at 15:42
  • is there any other hotkey to select all text? because that way i can easily do frequent operations like cut or copy. – GorvGoyl Aug 30 '21 at 17:04
  • 1
    @GorvGoyl I don't think there are any other ways supported by Visual Studio Code. This seems to be the only "Select All" option for the terminal. By default a bash terminal uses CTRL + Insert to copy, and Shift + Insert to paste. And using a mouse, you can easily select the text you wish. You can also hold shift, click where you wish to start selecting, then click where you wish to select to, and it will select between your two clicks - https://stackoverflow.com/a/68388676/6530134 – Timothy G. Aug 30 '21 at 17:25