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/


posted @   清霜辰  阅读(0)  评论(0编辑  收藏  举报  
相关博文:
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· DeepSeek 开源周回顾「GitHub 热点速览」
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
点击右上角即可分享
微信分享提示