zoukankan      html  css  js  c++  java
  • Windows Terminal 配置文件

    https://github.com/microsoft/terminal/releases

    如果考虑离线安装,建议下载 PreinstallKit 包,安装文件是 *.msixbundle 文件。
    Microsoft.WindowsTerminal_1.2.2381.0_8wekyb3d8bbwe.msixbundle_Windows10_PreinstallKit.zip

    教程:https://docs.microsoft.com/zh-cn/windows/terminal/

    配置文件位置:%appdata%..LocalPackagesMicrosoft.WindowsTerminal_8wekyb3d8bbweLocalStatesettings.json

    离线安装
    1. 需要系统安装了 Desktop Bridge VC++ v14 Redistributable Package
    https://www.microsoft.com/en-us/download/details.aspx?id=53175

    2. 解压 PreinstallKit.zip
    3. 进入 PreinstallKit 目录,以管理员身份启动 CMD,运行下面 Dism 命令

    dism /online /add-provisionedappxpackage /packagepath:1d5af5799bc14cbbb44f525e79581d2b.msixbundle /licensepath=1d5af5799bc14cbbb44f525e79581d2b_License1.xml /customdatapath:MPAP_1d5af5799bc14cbbb44f525e79581d2b_001.provxml

    其中 /packagepath,/licensepath 和 /customdatapath 都可以使用绝对路径。
    安装成功后,在“开始”菜单中,就可以找到 Windows Terminal 程序。

    如果不想使用自定义目录,直接将 PreinstallKit 包中的 .msibundle 和对应的 msix 解压到一个自定义的文件夹,
    运行其中的 wt.exe 或者 WindowsTerminal.exe

    {
        "$schema": "https://aka.ms/terminal-profiles-schema",
        "defaultProfile": "{f323ab3c-9641-4904-a3a6-dc4e4992b6ae}",
        "copyOnSelect": false,
        "copyFormatting": false,
        // "theme": "light",
        "profiles": {
            "defaults": {
                "acrylicOpacity": 0.7,
                // "colorScheme": "Frost",
                // "cursorColor": "#000000",
                "fontFace": "Cascadia Code PL",
                "useAcrylic": true
            },
            "list": [
                {
                    "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
                    "name": "Windows PowerShell",
                    "commandline": "powershell.exe",
                    "hidden": false
                },
                {
                    "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"
                },
                {
                    "guid": "{f323ab3c-9641-4904-a3a6-dc4e4992b6ae}",
                    "name": "Git Bash",
                    "commandline": "%programfiles%\Git\bin\bash.exe --login",
                    "hidden": false,
                    "closeOnExit": true,
                    "fontFace": "Cascadia Code PL",
                    "icon": "%programfiles%\Microsoft VS Code\resources\app\extensions\git\resources\icons\git.png"
                }
            ]
        },
        "schemes": [
            {
                "name": "Frost",
                "background": "#FFFFFF",
                "black": "#3C5712",
                "blue": "#17b2ff",
                "brightBlack": "#749B36",
                "brightBlue": "#27B2F6",
                "brightCyan": "#13A8C0",
                "brightGreen": "#89AF50",
                "brightPurple": "#F2A20A",
                "brightRed": "#F49B36",
                "brightWhite": "#741274",
                "brightYellow": "#991070",
                "cyan": "#3C96A6",
                "foreground": "#000000",
                "green": "#6AAE08",
                "purple": "#991070",
                "red": "#8D0C0C",
                "white": "#6E386E",
                "yellow": "#991070"
            }
        ],
        "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"
            }
        ]
    }

    注册右键菜单(需要用管理员身份运行)

    Microsoft.Terminal.Here.bat

    :: install or uninstall windows terminal here
    :: written by m2nlight
    @echo off
    setlocal enabledelayedexpansion
    set regkey=HKCRDirectoryBackgroundshellwt_shell
    set regkey2=HKCRDirectoryshellwt_shell
    set exe="%userprofile%AppDataLocalMicrosoftWindowsAppswt.exe"
    set icon=%exe%
    if exist %exe% (
        set regkey2=
        set icon=
    )
    set title=Windows Terminal
    set cmdText=Open in Windows Terminal
    set cmdLine="%exe%"
    :: check UAC
    set getadminfile="%temp%getadmin.vbs"
    echo %title%
    echo ============================
    echo Starting, please allow UAC window...
    >nul 2>nul "%SYSTEMROOT%system32cacls.exe" "%SYSTEMROOT%system32configSYSTEM"
    if %ERRORLEVEL% equ 0 (
        echo goto start
        goto :start
    ) else (
        if %ERRORLEVEL% equ 2 (
            goto :pathErr
        ) else (
            goto :getUAC
        )
    )
    :pathErr
    echo.
    echo Please open "%~n0%~x0" in explorer.exe
    echo.
    echo Press any key to explore the folder...
    pause>nul
    start "" "%SYSTEMROOT%system32explorer.exe" /select,"%~f0"
    goto :eof
    :getUAC
    echo Set sh = CreateObject^("Shell.Application"^) > %getadminfile%
    echo sh.ShellExecute "%~f0", "", "", "runas", 1 >> %getadminfile%
    ping 127.1 -n 1 >nul
    "%SYSTEMROOT%system32cscript.exe" %getadminfile% >nul 2>nul
    goto :eof
    :start
    if exist %getadminfile% ( del %getadminfile% )
    cls
    rem UAC code end
    echo %title%
    echo ============================
    :: check is installed
    reg query "%regkey%" >nul 2>nul
    if errorlevel 1 goto :install
    goto :uninstall
    :install
    :: check wt.exe is existed
    if not exist "%exe%" (
        echo Please install %title%, first!
        pause>nul
        goto :eof
    ) else (
        :: find WindowsTerminal.exe and set icon
        if "%icon%"=="" (
            for /f %%i in ('dir /b /w "%programfiles%WindowsAppsMicrosoft.WindowsTerminal_*"') do (
                set wtfull=%programfiles%WindowsApps\%%~iWindowsTerminal.exe
                if exist "!wtfull!" (
                    set icon=!wtfull!
                    goto :breakfor
                )
            )
        )
        :breakfor
        if not "%regkey%"=="" call :regadd "%regkey%"
        if not "%regkey2%"=="" call :regadd "%regkey2%"
        echo %cmdText% is installed
    )
    goto :end
    
    :regadd
    reg add "%~1" /ve /t REG_SZ /d "%cmdText%" /f >nul 2>nul
    if not "%icon%"=="" reg add "%~1" /v Icon /t REG_SZ /d "%icon%" /f >nul 2>nul
    reg add "%~1command" /ve /t REG_SZ /d "%cmdLine%" /f >nul 2>nul
    goto :eof
    
    :uninstall
    set /p ok=Uninstall %title% (y/N)?^ 
    if /i "%ok%"=="y" (
        if not "%regkey%"=="" reg delete "%regkey%" /f >nul 2>nul
        if not "%regkey2%"=="" reg delete "%regkey2%" /f >nul 2>nul
        echo %cmdText% is uninstalled
    ) else (
        goto :eof
    )
    goto :end
    :end
    timeout /t 5
  • 相关阅读:
    【原】用Java编写第一个区块链(二)
    SpringBoot 下配置 IDEA 热部署
    【原】用Java编写第一个区块链(一)
    【译】如何入门区块链学习
    轻量级微服务架构【读书笔记4】
    Ubuntu 下命令安装 ZooKeeper
    Ubuntu 下命令安装 Java
    集体智慧编程1寻找相近用户
    SfM执行流程
    SfM环境的搭建windows8.1+vs2010
  • 原文地址:https://www.cnblogs.com/Bob-wei/p/13657890.html
Copyright © 2011-2022 走看看