zoukankan      html  css  js  c++  java
  • Get 如何打造一款属于自己的WindowsTerminal

    前一阵很热的一款软件 Terminal,也算是微软对丑了这么久的命令窗口的一个交代,Terminal优化了代码显示和自定义功能,可以在一个窗口下,可以自定义背景、文字大小、文字颜色等诸多功能,今天我来分享下自定义的细节部分,让你快速的上手属于自己的Terminal命令行!

    先展示下我设计好的预览图,我比较喜欢的一个背景

    我们打开Windows自带的软件商店,搜索Windows Terminal,点击安装,把这个软件安装到自己的电脑上

    安装好之后是这样的

    初次安装好之后,应该是黑底白字的,这时候样式需要我们自己来配置,我们在下拉箭头里找到设置,点击设置会弹出配置文件,这就是我们自定义terminal的地方了

    
    
    // 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",
     
           //第一个位置就是默认打开的窗口的位置,也就是你启动这个Terminal的时候,开启的哪个命令行,我这里设置的是cmd为启动显示的窗口
           "defaultProfile": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
        "profiles":
        {
            "defaults":
            {
                // Put settings here that you want to apply to all profiles
            },
            "list":
            [
              {
                    // Make changes here to the cmd.exe profile
                 //在这里设置cmd窗口的树形
                "acrylicOpacity" : 0.75,
                 //背景图片这个根据自己的需要进行设置,图片可以设置为GIF动态图,很有感觉
                "backgroundImage" : "D://fastSoftware//photo//girl.jpg",  
                 //背景图像透明度
                "backgroundImageOpacity" : 0.95,
                "closeOnExit" : true, 
                "commandline" : "cmd.exe",
                "cursorColor" : "#C50F1F",
                "cursorShape" : "bar", 
                //显示字体大小
                "fontSize" : 11,  
    	    "colorScheme" : "CMD", 
                "guid" : "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",  
                "icon" : "ms-appx:///ProfileIcons/{0caa0dad-35be-5f56-a8ff-afceeeaa6101}.png",
                //在下拉菜单里显示的名称
                "name" : "cmd",
                //上下左右内边距
                "padding" : "2,2,2,2",
                "snapOnInput" : true, 
                //标题显示名称
                "tabTitle" : "cmd",
                "useAcrylic" : false 
                },
                {
                    //这是我安装的Windows下的linux字系统,我只是简单的配置了一个背景
                    "guid": "{46ca431a-3a87-5fb3-83cd-11ececc031d2}",
                    "hidden": false,
                    "name": "linux",
                    "backgroundImage" : "D://fastSoftware//photo//girl.jpg",  
                    "source": "Windows.Terminal.Wsl"
                },
                {
                    // Make changes here to the powershell.exe profile
                    //这是Windows自带的powershell,同样我也知识简单的配置了一下背景,因为用到的次数少
                    "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
                    "name": "Windows PowerShell",
                    "commandline": "powershell.exe",
                    "hidden": false,
                    "cursorColor" : "#C50F1F",
                    "backgroundImage" : "D://fastSoftware//photo//girl.jpg"
                },
                {
                    "guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}",
                    "hidden": false,
                    "name": "Azure Cloud Shell",
                    "source": "Windows.Terminal.Azure"
                }
            ]
        },
    
        // Add custom color schemes to this array
        "schemes": [
    {
                "background" : "#000000",   
                "black" : "#0C0C0C",
                "blue" : "#0037DA",
                "brightBlack" : "#767676",
                "brightBlue" : "#3B78FF",
                "brightCyan" : "#61D6D6",
                "brightGreen" : "#16C60C",
                "brightPurple" : "#B4009E",
                "brightRed" : "#E74856",
                "brightWhite" : "#F2F2F2",
                "brightYellow" : "#F9F1A5",
                "cyan" : "#DE813B",
                "foreground" : "#FFFFFF",   
                "green" : "#13A10E",
                "name" : "CMD",            
                "purple" : "#881798",
                "red" : "#C50F1F",
                "white" : "#CCCCCC",
                "yellow" : "#C19C00"
            }
            ],
    
        // Add any keybinding overrides to this array.
        // To unbind a default keybinding, set the command to "unbound"
        "keybindings": []
    }
    
    
    

    官方的配置文档详见下面连接,经常使用命令行的小伙伴可要记得尝试哟,更多玩法可以留言探索

    https://docs.microsoft.com/zh-cn/windows/terminal/customize-settings/global-settings

  • 相关阅读:
    LINQ To SQL: Eager Loading
    返回JSon格式数据
    Tips
    Easyui的DateBox日期格式化
    jquery treeview 展开指定节点,选中指定节点
    jquery treeview 功能参数
    Javascript 中 ShowModalDialog 的使用方法
    GetDlgItem用法
    20个开源项目托管站点推荐
    DLINQ(十): 分层构架的例子
  • 原文地址:https://www.cnblogs.com/nanstar/p/13367776.html
Copyright © 2011-2022 走看看