Git Bash and Cygwin in Windows Terminal
1. Git Bash
-
Open Windows Terminal
-
Enter the
Settings
page (Ctrl + ,
) -
Click the
Add a new profile
on the left bottom panel -
On the
Add a new profile
page, clickNew empty profile
orDuplicate
from an existed profile -
On the new profile page, fill the following options:
-
Name:
Git Bash
-
Command Line:
C:\Program Files\Git\bin\bash.exe -i -l
The -i -l
or--interactive --login
options will make Git Bash work on non-ASCII text well.-
Without
-i -l
:$ ls -l /tmp/hello/ total 0 -rw-r--r-- 1 ousia 197121 0 Aug 29 16:46 '□□'$'\226''□'$'\225\214'
-
With
-i -l
:$ ls -l /tmp/hello/ total 0 -rw-r--r-- 1 ousia 197121 0 Aug 29 16:46 世界
-
-
Starting Directory:
%USERPROFILE%
-
Icon:
C:\Program Files\Git\git-bash.exe
-
-
Click the
Save
on the right bottom to finish it.
To solve Git not displaying unicode file names:
You can also specify the
|
2. Cygwin
-
Run setup-x86_64.exe any time you want to update or install a Cygwin package for 64-bit windows.
-
The setup program will check by default if it runs with administrative privileges and, if not, will try to elevate the process. If you want to avoid this behaviour and install under an unprivileged account just for your own usage, run setup with the
--no-admin
option../setup-x86_64.exe --no-admin
-
Add the
ROOT_INSTALL_DIRECTORY
+bin
directory to thePATH
environment, such as:C:\cygwin64\bin