Windows 终端 Terminal 配置

Windows 终端 Terminal 配置

修改默认启动的命令

点“+”想启动哪个,将配置文件中list标签中那个的顺序排在最前
在这里插入图片描述

或者在GUI设置中配置,如下图
在这里插入图片描述


添加 cmder 到 Windows Terminal

cmder 下载地址 https://github.com/cmderdev/cmder/releases
修改cmd启动项,最终配置如下

{
    // Make changes here to the cmd.exe profile.
    "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6102}",
    "name": "cmder",
    // 注意更换路径,注意其中的左斜线、右斜线
    "commandline": "cmd.exe /k \"D:/android/cmder_mini/cmder_mini_1.3.18/vendor/init.bat\"",
    "icon": "D:/android/cmder_mini/cmder_mini_1.3.18/icons/cmder.ico",
    // 默认启动目录配置
   "startingDirectory":"D:/code/",
    "hidden": false
},

目前 Windows Terminal 越来越强大,已经支持GPU渲染,可以跟 cmder 媲美

cmder 一个比较好的点:cmder 启动 GitBash 后,可以直接转换 粘贴的 Windows 路径为 linux 路径 。
而在 终端 Git Bash 中,需要给路径加引号 cd 'D:\download\'


添加 git bash 到 Windows Terminal

在配置文件profiles–>list中添加如下

{
	"guid": "{00000000-0000-0000-ba54-000000000002}",
	"commandline": "%PROGRAMFILES%/git/usr/bin/bash.exe -i -l",
	// "commandline": "%USERPROFILE%/AppData/Local/Programs/Git/bin/bash.exe -l -i",
	// "commandline": "%USERPROFILE%/scoop/apps/git/current/usr/bin/bash.exe -l -i",
	"icon": "%PROGRAMFILES%/Git/mingw64/share/git/git-for-windows.ico",
	// "icon": "%USERPROFILE%/AppData/Local/Programs/Git/mingw64/share/git/git-for-windows.ico",
	// "icon": "%USERPROFILE%/apps/git/current/usr/share/git/git-for-windows.ico",
	"name" : "Git Bash",
	"startingDirectory" : "D:/code/"
},

在windows 新版的 git 安装时可选 自动添加 Git bashWindows Terminal
参考自 adding-git-bash-to-the-new-windows-terminal


为Windows PowerShell 配置别名 Alias

  1. 运行 echo $profile 会显示别名配置文件,然后手动按目录创建此文件
  2. 打开此文件,按一下格式添加
    function 别名 { 需要替代的命令,可以包含空格 }
  3. 重启 Windows PowerShell

参考自
https://blog.vvzero.com/2019/07/22/set-user-alias-for-windows-PowerShell/


更换 Windows PowerShell 主题配色

  1. 安装依赖,命令如下
Install-Module posh-git -Scope CurrentUser 
Install-Module oh-my-posh -Scope CurrentUser
  1. 导入使用主题 ,命令如下
Import-Module posh-git
Import-Module oh-my-posh
Set-Theme Paradox

参考自
https://github.com/dahlbyk/posh-git
https://huxiaofan.com/diary/beauty-powershell/


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

清霜辰

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值