Windows Terminal 配置 Git Bash

Command Git Windows About 725 words

配置

bash.exe配置到Command line

%USERPROFILE%\AppData\Local\Programs\Git\bin\bash.exe --login -i

默认开始文件夹

打开Bash时默认打开文件夹是Starting directory,配置Starting directory后即可默认是~Home目录)。

%USERPROFILE%

设置默认打开

打开Windows Terminal时设置默认打开Bash

在左侧菜单的第一个菜单项Startup中,设置Default profile即可。

打开时默认进入英文输入法

在左侧菜单的第一个菜单项Startup中,设置Default IME input mode,选择Alphanumeric Half-Width(English)

下拉菜单第一位

Tab的下拉菜单中,默认是Windows PowerShellCommand PromptAzure Cloud Shell,然后才是自定义添加的Bash

点击左下角的Open JSON file,编辑profiles下的list数组,调整位置即可。

无 ll 命令

添加--login -i参数。

如果没有添加--login -i,则不会加载/etc/bash.bashrc,则不会有ll命令。

闪屏问题

echo "set bell-style none" > ~/.inputrc

ll 不显示隐藏文件

echo "alias ll='ls -la --color=auto'" > ~/.bashrc

加载配置(热更新,也可以直接关闭Bash再打开)。

source ~/.bashrc
Views: 19 · Posted: 2026-05-08

———         Thanks for Reading         ———

Give me a Star, Thanks:)

https://github.com/fendoudebb/LiteNote

扫描下方二维码关注公众号和小程序↓↓↓

扫描下方二维码关注公众号和小程序↓↓↓
Prev Post
Today In History
Browsing Refresh