摘要:安装是一个面向命令行工具和如命令提示符和适用于的子系统用户的新式终端应用程序。注意需要或更高版本。配置在下使用快捷键打开的配置文件。命令提示符安装是的一个版本,它开源跨平台和且为管理异类环境和混合云而构建。
Windows Terminal 是一个面向命令行工具和 shell(如命令提示符、PowerShell 和适用于 Linux 的 Windows 子系统 (WSL))用户的新式终端应用程序。 它的主要功能包括多个选项卡、窗格、Unicode 和 UTF-8 字符支持、GPU 加速文本呈现引擎,还可以用于创建你自己的主题并自定义文本、颜色、背景和快捷键绑定。
注意:Windows Terminal 需要 Windows 10 1903 (build 18362) 或更高版本。
在 Terminal 下使用快捷键 Ctrl + , 打开 Windows Terminal 的配置文件 Setting.json
。
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"defaultProfile": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"theme": "dark",
"alwaysShowTabs": true,
"tabWidthMode": "titleLength",
"launchMode": "default",
"profiles":
{
"defaults":
{
// Put settings here that you want to apply to all profiles.
"name" : "PowerShell",
"closeOnExit": true,
"colorScheme": "Campbell",
"source" : "Windows.Terminal.PowershellCore",
"acrylicOpacity": 0.7,
"cursorShape" : "bar",
"cursorColor" : "#00FFFF",
"fontFace" : "Cascadia Code PL",
"useAcrylic": true
},
"list":
[
{
// Make changes here to the powershell.exe profile.
"guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"name": "Windows PowerShell",
"commandline": "C:Program FilesPowerShell7pwsh.exe -nologo",
"cursorShape" : "bar",
"hidden": false
},
{
// Make changes here to the cmd.exe profile.
"guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
"name": "命令提示符",
"commandline": "cmd.exe",
"cursorShape" : "bar",
"hidden": false
},
{
"guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}",
"name": "Azure Cloud Shell",
"source": "Windows.Terminal.Azure",
"cursorShape" : "bar",
"hidden": false
},
{
"guid": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
"name": "PowerShell",
"source": "Windows.Terminal.PowershellCore",
"cursorShape" : "bar",
"hidden": false
}
]
},
// Add custom color schemes to this array.
// To learn more about color schemes, visit https://aka.ms/terminal-color-schemes
"schemes": [
{
"background": "#1A1A1A",
"black": "#1A1A1A",
"blue": "#9D65FF",
"brightBlack": "#625E4C",
"brightBlue": "#9D65FF",
"brightCyan": "#58D1EB",
"brightGreen": "#98E024",
"brightPurple": "#F4005F",
"brightRed": "#F4005F",
"brightWhite": "#F6F6EF",
"brightYellow": "#E0D561",
"cyan": "#58D1EB",
"foreground": "#C4C5B5",
"green": "#98E024",
"name": "Monokai Soda",
"purple": "#F4005F",
"red": "#F4005F",
"white": "#C4C5B5",
"yellow": "#FA8419"
},
{
"background": "#0C0C0C",
"black": "#0C0C0C",
"blue": "#0037DA",
"brightBlack": "#767676",
"brightBlue": "#3B78FF",
"brightCyan": "#61D6D6",
"brightGreen": "#16C60C",
"brightPurple": "#B4009E",
"brightRed": "#E74856",
"brightWhite": "#F2F2F2",
"brightYellow": "#F9F1A5",
"cyan": "#3A96DD",
"foreground": "#F2F2F2",
"green": "#13A10E",
"name": "Campbell",
"purple": "#881798",
"red": "#C50F1F",
"white": "#CCCCCC",
"yellow": "#C19C00"
},
{
"background": "#282C34",
"black": "#282C34",
"blue": "#61AFEF",
"brightBlack": "#5A6374",
"brightBlue": "#61AFEF",
"brightCyan": "#56B6C2",
"brightGreen": "#98C379",
"brightPurple": "#C678DD",
"brightRed": "#E06C75",
"brightWhite": "#DCDFE4",
"brightYellow": "#E5C07B",
"cyan": "#56B6C2",
"foreground": "#DCDFE4",
"green": "#98C379",
"name": "One Half Dark",
"purple": "#C678DD",
"red": "#E06C75",
"white": "#DCDFE4",
"yellow": "#E5C07B"
},
{
"background": "#FAFAFA",
"black": "#383A42",
"blue": "#0184BC",
"brightBlack": "#4F525D",
"brightBlue": "#61AFEF",
"brightCyan": "#56B5C1",
"brightGreen": "#98C379",
"brightPurple": "#C577DD",
"brightRed": "#DF6C75",
"brightWhite": "#FFFFFF",
"brightYellow": "#E4C07A",
"cyan": "#0997B3",
"foreground": "#383A42",
"green": "#50A14F",
"name": "One Half Light",
"purple": "#A626A4",
"red": "#E45649",
"white": "#FAFAFA",
"yellow": "#C18301"
},
{
"background": "#073642",
"black": "#073642",
"blue": "#268BD2",
"brightBlack": "#002B36",
"brightBlue": "#839496",
"brightCyan": "#93A1A1",
"brightGreen": "#586E75",
"brightPurple": "#6C71C4",
"brightRed": "#CB4B16",
"brightWhite": "#FDF6E3",
"brightYellow": "#657B83",
"cyan": "#2AA198",
"foreground": "#FDF6E3",
"green": "#859900",
"name": "Solarized Dark",
"purple": "#D33682",
"red": "#D30102",
"white": "#EEE8D5",
"yellow": "#B58900"
},
{
"background": "#FDF6E3",
"black": "#073642",
"blue": "#268BD2",
"brightBlack": "#002B36",
"brightBlue": "#839496",
"brightCyan": "#93A1A1",
"brightGreen": "#586E75",
"brightPurple": "#6C71C4",
"brightRed": "#CB4B16",
"brightWhite": "#FDF6E3",
"brightYellow": "#657B83",
"cyan": "#2AA198",
"foreground": "#073642",
"green": "#859900",
"name": "Solarized Light",
"purple": "#D33682",
"red": "#D30102",
"white": "#EEE8D5",
"yellow": "#B58900"
}
],
// 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":
[
{ "command": {"action": "copy", "singleLine": false }, "keys": "ctrl+c" },
{ "command": "paste", "keys": "ctrl+v" },
{ "command": "find", "keys": "ctrl+shift+f" },
{ "command": { "action": "splitPane", "split": "auto", "splitMode": "duplicate" }, "keys": "alt+shift+d" },
{ "command": "closeTab", "keys": ["ctrl+w"]},
{ "command": "newTab", "keys": ["ctrl+t"]},
{ "command": "newTabProfile0", "keys": ["ctrl+shift+1"]},
{ "command": "newTabProfile1", "keys": ["ctrl+shift+2"]},
{ "command": "newTabProfile2", "keys": ["ctrl+shift+3"]},
{ "command": "newTabProfile3", "keys": ["ctrl+shift+4"]},
{ "command": "newTabProfile4", "keys": ["ctrl+shift+5"]},
{ "command": "newTabProfile5", "keys": ["ctrl+shift+6"]},
{ "command": "newTabProfile6", "keys": ["ctrl+shift+7"]},
{ "command": "newTabProfile7", "keys": ["ctrl+shift+8"]},
{ "command": "newTabProfile8", "keys": ["ctrl+shift+9"]},
{ "command": "nextTab", "keys": ["ctrl+tab"]},
{ "command": "openSettings", "keys": ["ctrl+,"]},
{ "command": "prevTab", "keys": ["ctrl+shift+tab"]},
{ "command": "scrollDown", "keys": ["ctrl+shift+down"]},
{ "command": "scrollDownPage", "keys": ["ctrl+shift+pgdn"]},
{ "command": "scrollUp", "keys": ["ctrl+shift+up"]},
{ "command": "scrollUpPage", "keys": ["ctrl+shift+pgup"]},
{ "command": "switchToTab0", "keys": ["alt+1"]},
{ "command": "switchToTab1", "keys": ["alt+2"]},
{ "command": "switchToTab2", "keys": ["alt+3"]},
{ "command": "switchToTab3", "keys": ["alt+4"]},
{ "command": "switchToTab4", "keys": ["alt+5"]},
{ "command": "switchToTab5", "keys": ["alt+6"]},
{ "command": "switchToTab6", "keys": ["alt+7"]},
{ "command": "switchToTab7", "keys": ["alt+8"]},
{ "command": "switchToTab8", "keys": ["alt+9"]}
]
}
PowerShell 7.0 是 PowerShell 的一个版本,它开源、跨平台(Windows、macOS 和 Linux)且为管理异类环境和混合云而构建。
在此版本中,我们引入了一些新功能,包括:
- 使用
ForEach-Object -Parallel
实现管道并行化新运算符:
- 三元运算符:
a ? b : c
- 管道链运算符:
||
和&&
- 空条件运算符:
??
和??=
- 简化且动态的错误视图和
Get-Error
cmdlet,以便更轻松地调查错误- 兼容层,使用户能够在隐式 Windows PowerShell 会话中导入模块
- 自动新版本通知
- 直接从 PowerShell 7 调用 DSC 资源的功能(实验性)
若要查看功能和修补程序的完整列表,请参阅更改日志。
命令行安装:
msiexec.exe /package PowerShell-7.0.3-win-x64.msi /quiet ADD_EXPLORER_CONTEXT_MENU_OPENPOWERSHELL=1 ENABLE_PSREMOTING=1 REGISTER_MANIFEST=1
更多 PoweerShell 安装说明请阅读 Installing PowerShell on Windows - Microsoft Docs 。
使用 Windows 系统字体在使用 oh-my-posh
主题时会出现乱码,所以需要安装命令行字体。
推荐字体:Powerline fonts
Cascadia Code
。 其中 Cascadia (Code|Mono) PL
包含 Powerline fonts
。
# Set Proxy
$Env:http_proxy="http://127.0.0.1:7890";$Env:https_proxy="http://127.0.0.1:7890"
# Trust PSGalleryI
# Install items without further prompts.
Set-PSRepository -name PSGallery -InstallationPolicy Trusted
# For less, Add-PAthVariable and a bunch of other useful commands that should be there out of the box
# Get the Powershell Community Extensions.
Install-Module Pscx -Scope CurrentUser
# For Remove-ItemSafely - ie, trashing files from the command line.
Install-Module -Name Recycle -Scope CurrentUser
# Install version 2.0.0-beta1 of PSReadLine
Install-Module -Name PSReadLine -AllowPrerelease -Scope CurrentUser -Force -SkipPublisherCheck
# Install posh-git and oh-my-posh.
Install-Module posh-git -Scope CurrentUser
Install-Module oh-my-posh -Scope CurrentUser
在文件资源管理器中添加鼠标右键菜单,不需要的可以跳过此步骤。
# githubusercontent
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString(https://raw.githubusercontent.com/lextm/windowsterminal-shell/master/install.ps1))
# cdnjs
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString(https://cdn.jsdelivr.net/gh/lextm/windowsterminal-shell@master/install.ps1))
# githubusercontent
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString(https://raw.githubusercontent.com/lextm/windowsterminal-shell/master/uninstall.ps1))
# cdnjs
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString(https://cdn.jsdelivr.net/gh/lextm/windowsterminal-shell@master/uninstall.ps1))
或者直接运行:
Remove-Item -Path Registry::HKEY_CURRENT_USERSOFTWAREClassesDirectoryshellMenuTerminal -Recurse -ErrorAction Ignore | Out-Null
Remove-Item -Path Registry::HKEY_CURRENT_USERSOFTWAREClassesDirectoryBackgroundshellMenuTerminal -Recurse -ErrorAction Ignore | Out-Null
Remove-Item -Path Registry::HKEY_CURRENT_USERSOFTWAREClassesDirectoryContextMenusMenuTerminalshell -Recurse -ErrorAction Ignore | Out-Null
Remove-Item -Path Registry::HKEY_CURRENT_USERSOFTWAREClassesDirectoryshellMenuTerminalAdmin -Recurse -ErrorAction Ignore | Out-Null
Remove-Item -Path Registry::HKEY_CURRENT_USERSOFTWAREClassesDirectoryBackgroundshellMenuTerminalAdmin -Recurse -ErrorAction Ignore | Out-Null
Remove-Item -Path Registry::HKEY_CURRENT_USERSOFTWAREClassesDirectoryContextMenusMenuTerminalAdminshell -Recurse -ErrorAction Ignore | Out-Null
更多信息请查阅 lextm - windowsterminal-shell 。
预览图:
文章版权归作者所有,未经允许请勿转载,若此文章存在违规行为,您可以联系管理员删除。
转载请注明本文地址:https://www.ucloud.cn/yun/125978.html
摘要:经过漫长的下载点击安装最新版本,然后便可一马平川安装体验该预览版何时推出正式版微软官方原话是这样的截至今天,终端和控制台已经成为开源的,您可以从上的存储库克隆,构建,运行和测试代码。前言 在一年一度的微软开发者大会Build 2019登场的Windows Terminal饱受好评,大家对其也是充满了兴趣和热情,程序员的朋友圈都被微软发布的最新终端 windows Terminal短短几天...
阅读 3541·2023-04-25 20:09
阅读 3743·2022-06-28 19:00
阅读 3064·2022-06-28 19:00
阅读 3088·2022-06-28 19:00
阅读 3180·2022-06-28 19:00
阅读 2883·2022-06-28 19:00
阅读 3053·2022-06-28 19:00
阅读 2641·2022-06-28 19:00