Felipe
Felipe

Reputation: 11959

VSCode terminal previous commands

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?

Upvotes: 11

Views: 11416

Answers (2)

Austin
Austin

Reputation: 1

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" }
 }

Upvotes: 0

Felipe
Felipe

Reputation: 11959

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

Upvotes: 11

Related Questions