11

I've been using the integrated terminal in Visual Studio Code a lot since it was added, but I noticed a very frustrating feature/bug.

I am using the Windows 10 Bash terminal, and cannot seem to access the previous command history by using the "Up" arrows. Did this get remapped to another key or does it simply not work?

1
  • See stackoverflow.com/a/70900927/836330 for how to bring up a QuickPick of recent terminal commands although I note that W10 bash is not currently supported. Commented Jan 28, 2022 at 22:25

3 Answers 3

11

Found the answer by accident, after accidentally hitting a few keys. It seems the most common commands have been mapped to the following defaults:

Previous Command: Ctrl+P

Next Command: Ctrl+N

Cursor Left: Ctrl+B (backwards)

Cursor Right: Ctrl+F (forwards)

Cursor Home: Ctrl+A

Cursor End: Ctrl+E (end)

Delete from cursor position: Ctrl+D (del)

Clear Screen: Ctrl+L

Sign up to request clarification or add additional context in comments.

1 Comment

On Windows 10 and VScode 1.53.2, I had to change the following for the Previous command to work: Keyboard shortcuts-> Right click on Go to File... -> Change when expression -> !terminalFocus Otherwise, Ctrl + P would always open the Go to file menu
0

This is not directly related to previous commands, but you can define keyboard short cuts for terminal commands in your keybindings.json for commonly used commands.

Here is an example of a command I created a short cut for:

 //Run expo go in terminal { "key": "ctrl+shift+e", "command": "workbench.action.terminal.sendSequence", "args": { "text": "npx expo start" } } 

Comments

-1

create new terminal that's the best thing that you can do

1 Comment

Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.