安装
官方github可下载最新的:github下载 下载完成后可以直接双击安装。Double clicking will be supported starting build 17698. For now, you can install through Powershell by running:
add-appxpackage <path-to-my msix>
配置文件:C:\Users\admin\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1
C:\Users\admin\AppData\Local\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\setting.json
设置默认以powershell打开,设置defaultProfile:
C:\Users\admin\AppData\Local\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.json
// This file was initially generated by Windows Terminal 1.0.1401.0
// It should still be usable in newer versions, but newer versions might have additional
// settings, help text, or changes that you will not see unless you clear this file
// and let us generate a new one for you.
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
// 璁剧疆榛樿鎵撳紑,杩欓噷鏄痯owershell
"defaultProfile": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
// You can add more global application settings here.
// To learn more about global settings, visit https://aka.ms/terminal-global-settings
// If enabled, selections are automatically copied to your clipboard.
"copyOnSelect": false,
// If enabled, formatted data is also copied to your clipboard
"copyFormatting": false,
// A profile specifies a command to execute paired with information about how it should look and feel.
// Each one of them will appear in the 'New Tab' dropdown,
// and can be invoked from the commandline with `wt.exe -p xxx`
// To learn more about profiles, visit https://aka.ms/terminal-profile-settings
"profiles":
{
"defaults":
{
// Put settings here that you want to apply to all profiles.
},
"list": [
{
"acrylicOpacity": 0.5, // 閫忔槑搴
"closeOnExit": true, // 鍏抽棴鐨勬椂鍊欓鍑哄懡浠ょ粓绔
"commandline": "D:\\Program Files\\Git\\git-bash.exe", // gitbash鐨勫懡浠よ鎵鍦ㄤ綅缃
"cursorColor": "#FFFFFF", // 鍏夋爣棰滆壊
"cursorShape": "bar", // 杩欎釜锛岃繕娌″彂鐜板暐浣滅敤
// "fontFace": "Fira Code Medium", // 瀛椾綋閰嶇疆锛屽鏋滀綘鐢佃剳娌℃湁杩欎釜瀛椾綋灏变笉瑕佺敤杩欐閰嶇疆浜
"fontSize": 14, // 缁堢瀛椾綋澶у皬
"guid": "{1c4de342-38b7-51cf-b940-2309a097f589}", // 鍞竴鐨勬爣璇嗭紝杩欎釜璁板緱鏀规垚鍜屽叾浠栫殑缁堢涓嶄竴鏍峰氨琛屼簡锛岄殢渚胯捣涓涓
"historySize": 9001, // emmm
"icon": "D:\\Program Files\\Git\\git-logo.jpg", // git鐨勫浘鏍囷紝鎵撳紑缁堢鏃跺欎細鐪嬪埌
"name": "Bash", // tab鏍忕殑鏍囬鏄剧ず
"padding": "10, 10, 10, 10", // 杈硅窛
// "snapOnInput": true, // emmm
// gitbash 鍚姩鐨勪綅缃紙榛樿鍦–鐩樼殑鐢ㄦ埛閲岄潰鐨勫氨鏄 ~ 锛
"startingDirectory": "D:\\WWW\\passport_v1.aoscdn.com",
"hidden": false
},
{
// Make changes here to the powershell.exe profile.
"guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"name": "Windows PowerShell",
"commandline": "powershell.exe",
"hidden": false
},
{
// Make changes here to the cmd.exe profile.
"guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
"name": "鍛戒护鎻愮ず绗",
"commandline": "cmd.exe",
"hidden": false
},
{
"guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}",
"hidden": false,
"name": "Azure Cloud Shell",
"source": "Windows.Terminal.Azure"
}]
},
// Add custom color schemes to this array.
// To learn more about color schemes, visit https://aka.ms/terminal-color-schemes
"schemes": [],
// Add custom keybindings to this array.
// To unbind a key combination from your defaults.json, set the command to "unbound".
// To learn more about keybindings, visit https://aka.ms/terminal-keybindings
"keybindings": [
// Copy and paste are bound to Ctrl+Shift+C and Ctrl+Shift+V in your defaults.json.
// These two lines additionally bind them to Ctrl+C and Ctrl+V.
// To learn more about selection, visit https://aka.ms/terminal-selection
{
"command":
{
"action": "copy",
"singleLine": false
},
"keys": "ctrl+c"
},
{
"command": "paste",
"keys": "ctrl+v"
},
// Press Ctrl+Shift+F to open the search box
{
"command": "find",
"keys": "ctrl+shift+f"
},
// Press Alt+Shift+D to open a new pane.
// - "split": "auto" makes this pane open in the direction that provides the most surface area.
// - "splitMode": "duplicate" makes the new pane use the focused pane's profile.
// To learn more about panes, visit https://aka.ms/terminal-panes
{
"command":
{
"action": "splitPane",
"split": "auto",
"splitMode": "duplicate"
},
"keys": "alt+shift+d"
},
{
"command":
{
"action": "splitPane",
"split": "horizontal",
"splitMode": "duplicate"
},
"keys": "alt+shift+-"
},
{
"command":
{
"action": "splitPane",
"split": "vertical",
"splitMode": "duplicate"
},
"keys": "alt+shift+plus"
}
]
}
为powershell设置快捷键:
function openSublime{start sublime_text}
Set-Alias sub openSublime
function sshConnect{ssh root@192.168.10.136}
Set-Alias ss sshConnect
function editHost{sub /c/Windows/System32/drivers/etc/hosts}
Set-Alias host editHost
配置示例:
{
"acrylicOpacity": 0.5, // 透明度
"closeOnExit": true, // 关闭的时候退出命令终端
"colorScheme": "Brogrammer", // 样式配置,你们是用不了这个的,详情看我另外一篇文章
"commandline": "E:\\Git\\bin\\bash.exe", // gitbash的命令行所在位置
"cursorColor": "#FFFFFF", // 光标颜色
"cursorShape": "bar", // 这个,还没发现啥作用
"fontFace": "Fira Code Medium", // 字体配置,如果你电脑没有这个字体就不要用这段配置了
"fontSize": 14, // 终端字体大小
"guid": "{1c4de342-38b7-51cf-b940-2309a097f589}", // 唯一的标识,这个记得改成和其他的终端不一样就行了,随便起一个
"historySize": 9001, // emmm
"icon": "E:\\Git\\git-icon.png", // git的图标,打开终端时候会看到
"name": "Bash", // tab栏的标题显示
"padding": "10, 10, 10, 10", // 边距
"snapOnInput": true, // emmm
"startingDirectory": "F:\\Desktop", // gitbash 启动的位置(默认在C盘的用户里面的就是 ~ )
"useAcrylic": true // 是否开启透明度
}
分割窗口:
左右分屏:Alt+Shift+=
上下分屏:Alt+Shift+-
取消分屏:Ctrl+Shift+w
教程地址:
https://docs.microsoft.com/zh-cn/windows/terminal/command-palette#adding-an-icon-to-a-command