Integrating Cygwin
with VSCode
in Windows
Installation
Follow guide from Cygwin.
Add terminal profile in settings.json
Add new profile for cygwin
, this will register a new option when we choose to launch a new integrated terminal.
json
{
"terminal.integrated.profiles.windows": {
"PowerShell": {
"source": "PowerShell",
"icon": "terminal-powershell"
},
"Command Prompt": {
"path": ["${env:windir}\\Sysnative\\cmd.exe", "${env:windir}\\System32\\cmd.exe"],
"args": [],
"icon": "terminal-cmd"
},
"Git Bash": {
"source": "Git Bash"
},
"Cygwin": {
"path": "C:\\cygwin64\\bin\\bash.exe",
"args": ["--login"],
"overrideName": true
}
},
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Then we got a new option to create a integrated terminal.
INFO
For more information: Terminal Profiles.
Change default working directory of cygwin in .bashrc
The default working directory of cygwin
is {installation-path}\home\{username}
like C:\cygwin64\home\anon
.
You might like to launch cygwin with working directory as the root of current user.
- Open cygwin, make sure you're at
~
bash
cd ~
1
- Execute this line into
.bashrc
.
bash
touch .bashrc && echo 'cd /cygdrive/c/users/{username}' >> .bashrc
1
- Check the content is successfully appended.
bash
cat .bashrc
1
- Launch a new cygwin instance, it will start at your user root.
Using System Proxy from Windows
Switch to ~
, append http_proxy
and https_proxy
to .bashrc
.
bash
cd ~ && echo "export http_proxy=<proxy:port>" >> .bashrc && echo "export https_proxy=<proxy:port>" >> .bashrc
1