Windows Terminal 是一個面向命令行工具和 shell(如命令提示符、PowerShell 和適用于 Linux 的 Windows 子系統(tǒng) (WSL))用戶的新式終端應(yīng)用程序。 它的主要功能包括多個選項(xiàng)卡、窗格、Unicode 和 UTF-8 字符支持、GPU 加速文本呈現(xiàn)引擎,還可以用于創(chuàng)建你自己的主題并自定義文本、顏色、背景和快捷鍵綁定。 [![repo](https://ryan-git-st" />

国产xxxx99真实实拍_久久不雅视频_高清韩国a级特黄毛片_嗯老师别我我受不了了小说

資訊專欄INFORMATION COLUMN

Windows Terminal 配置 oh-my-posh

Tecode / 2209人閱讀

摘要:安裝是一個面向命令行工具和如命令提示符和適用于的子系統(tǒng)用戶的新式終端應(yīng)用程序。注意需要或更高版本。配置在下使用快捷鍵打開的配置文件。命令提示符安裝是的一個版本,它開源跨平臺和且為管理異類環(huán)境和混合云而構(gòu)建。

安裝 Windows Terminal

Windows Terminal 是一個面向命令行工具和 shell(如命令提示符、PowerShell 和適用于 Linux 的 Windows 子系統(tǒng) (WSL))用戶的新式終端應(yīng)用程序。 它的主要功能包括多個選項(xiàng)卡、窗格、Unicode 和 UTF-8 字符支持、GPU 加速文本呈現(xiàn)引擎,還可以用于創(chuàng)建你自己的主題并自定義文本、顏色、背景和快捷鍵綁定。

repo

注意:Windows Terminal 需要 Windows 10 1903 (build 18362) 或更高版本。

配置 Windows Terminal

在 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

PowerShell 7.0 是 PowerShell 的一個版本,它開源、跨平臺(Windows、macOS 和 Linux)且為管理異類環(huán)境和混合云而構(gòu)建。

在此版本中,我們引入了一些新功能,包括:

  • 使用 ForEach-Object -Parallel 實(shí)現(xiàn)管道并行化
  • 新運(yùn)算符:

    • 三元運(yùn)算符:a ? b : c
    • 管道鏈運(yùn)算符:||&&
    • 空條件運(yùn)算符:????=
  • 簡化且動態(tài)的錯誤視圖和 Get-Error cmdlet,以便更輕松地調(diào)查錯誤
  • 兼容層,使用戶能夠在隱式 Windows PowerShell 會話中導(dǎo)入模塊
  • 自動新版本通知
  • 直接從 PowerShell 7 調(diào)用 DSC 資源的功能(實(shí)驗(yàn)性)

若要查看功能和修補(bǔ)程序的完整列表,請參閱更改日志

repo

命令行安裝:

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 系統(tǒng)字體在使用 oh-my-posh 主題時會出現(xiàn)亂碼,所以需要安裝命令行字體。

推薦字體:Powerline fonts Cascadia Code 。 其中 Cascadia (Code|Mono) PL 包含 Powerline fonts

repo

repo

安裝 PowerShell 插件

# 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

添加鼠標(biāo)右鍵菜單

在文件資源管理器中添加鼠標(biāo)右鍵菜單,不需要的可以跳過此步驟。

repo

添加菜單

# 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))

或者直接運(yùn)行:

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

預(yù)覽圖:

image.png

image.png

文章版權(quán)歸作者所有,未經(jīng)允許請勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。

轉(zhuǎn)載請注明本文地址:http://specialneedsforspecialkids.com/yun/125978.html

相關(guān)文章

  • 提前體驗(yàn)飽受期待的Windows Terminal

    摘要:經(jīng)過漫長的下載點(diǎn)擊安裝最新版本,然后便可一馬平川安裝體驗(yàn)該預(yù)覽版何時推出正式版微軟官方原話是這樣的截至今天,終端和控制臺已經(jīng)成為開源的,您可以從上的存儲庫克隆,構(gòu)建,運(yùn)行和測試代碼。前言 ? 在一年一度的微軟開發(fā)者大會Build 2019登場的Windows Terminal飽受好評,大家對其也是充滿了興趣和熱情,程序員的朋友圈都被微軟發(fā)布的最新終端 windows Terminal短短幾天...

    terro 評論0 收藏0

發(fā)表評論

0條評論

最新活動
閱讀需要支付1元查看
<