Let's use VSCode's integrated terminal
Hello.
I'm Mandai, in charge of Wild on the development team.
Visual Studio Code (VSCode) has a reputation for becoming more familiar the more you use it.
This time, I will introduce some tricks to make the terminal more convenient, focusing on the Windows environment.
Command line tool defaults
This applies to the command line or PowerShell.
If you have a shell environment other than the default that you want to use, add the following settings to settings.json.
{ // Standard Windows command line // "terminal.integrated.shell.windows": "C:\\Windows\\sysnative\\cmd.exe" // PowerShell // "terminal.integrated.shell.windows": "C:\\Windows\\sysnative\\WindowsPowerShell\\v1.0\\powershell.exe" // Git Bash // "terminal.integrated.shell.windows": "C:\\Program Files\\Git\ \bin\\bash.exe" // Bash on Ubuntu //"terminal.integrated.shell.windows": "C:\\Windows\\sysnative\\bash.exe" }
The settings.json editing screen will appear when you press Ctrl + P and type settings.
It seems that it is not possible to use multiple shells, so you will have to choose one of the four shells that you are familiar with.
If you want a Linux-like shell, Git Bash or Bash on Ubuntu (Insider Preview required) is a bit of a pain as it cannot be used out of the box, but it should be more efficient to use a familiar environment. So, I can't help but take a little time.
Useful keyboard shortcuts for Terminal within VSCode
VSCode is designed to allow you to do most things without using a mouse.
There are some nice shortcuts around the terminal, so I've summarized them in a table.
Ctrl + @ | Show/hide terminal |
---|---|
Ctrl + Shift + @ | Open a new terminal (show the terminal if it's not visible) |
Ctrl+K | clearing the terminal |
Ctrl + Up | Scroll up one line at a time |
Ctrl + Down | Scroll down one line at a time |
Ctrl + PageUp | Scroll up one screen at a time |
Ctrl + Page Down | Scroll down one screen at a time |
Ctrl + Home | scroll to top of terminal |
Ctrl + End | Scroll to the end of the terminal |
In the command palette, ">trs" |
Copy selected string and execute in terminal Regarding this, the command palette can be narrowed down by spaces, so the combinations are endless. Try finding your own combination. As new features increase, it may become difficult to narrow down to one item. |
Ctrl+c | For Windows, Shift key is not required for copying |
Ctrl+v | For Windows, Shift key is not required for pasting |
Note that there are no shortcut key assignments for changing the focus to a terminal, moving to the previous or next terminal if multiple terminals are running, or killing a terminal, so you will need to set them yourself.
By the way, if you want a command prompt in a separate window, press "Ctrl + Shift + c".
If you want to change the terminal that opens in this case, change the value of the key "terminal.external.windowsExec" in settings.json.
The value entered here is the same as the JSON string here,
That's it.