terminal美化

termnial

配置文件详解

// 配置文件
"profiles":
{
    // 适用所有配置文件的设置
    "defaults":
    {
        "startingDirectory": "%USERPROFILE%", // 起始目录
        "icon": "C:\\Users\\DustinWinFiles\\Pictures\\Java.png", // 图标
        "tabTitle": "开始学习啦", // 自定义选项卡标题
        "suppressApplicationTitle": true, // 禁止shell更改标题
        "fontFace": "Fira Code Retina", // 字体
        "fontSize": 12, // 字体大小
        "fontWeight": "normal", // 字体粗细
        "padding": "8, 8, 8, 8", // 填充(内容距离界面的内部距离)
        "antialiasingMode": "cleartype", // 消除文本锯齿
        "cursorShape": "bar", // 光标形状
        "cursorColor": "#E6FF00", // 光标颜色
        //"cursorHeight": 25, // 光标高度("cursorShape"设置为"vintage"时可用)
        "altGrAliasing": true, // AltGr别名
        "colorScheme": "Ubuntu", // 配色方案
        //"selectionBackground": "#0000e6", // 所选内容的背景色(选用"colorScheme"内的)
        "useAcrylic": true, // 启用 acrylic(毛玻璃特效)
        "acrylicOpacity": 0.25, // Acrylic 不透明度
        "backgroundImage": "C:\\Users\\DustinWinFiles\\Pictures\\colorful.jpg", // 背景图像设置
        "backgroundImageStretchMode": "uniformToFill", // 背景图像拉伸模式
        "backgroundImageAlignment": "center", // 背景图像对齐
        "backgroundImageOpacity": 0.5, // 背景图像不透明度
        "scrollbarState": "visible", // 滚动条可见性
        "snapOnInput": true, // 键入时滚动到输入行
        "historySize": 9001, // 历史记录大小
        "closeOnExit": "graceful", // 退出时配置文件的关闭方式(输入exit退出命令窗口)
        //"experimental.retroTerminalEffect": false // 怀旧式终端效果
        "alwaysOnTop": true // 始终处于顶部模式
          },
background 如果在profile中设置的话会覆盖scheme中的background。
acrylicOpacity这个属性生效的前提是useAcrylic的值为true
backgroundImage 等属性生效的前提是useAcrylic的值为false

主题的配

在profiles.json文件中的schemes属性中
主题预览
schemes.Banana Blueberry.json
在这里插入图片描述

https://github.com/mbadolato/iTerm2-Color-Schemes/blob/master/windowsterminal/Banana%20Blueberry.json

安装主题教程:

https://www.bilibili.com/read/cv3878542

安装Oh-my-posh

Install-Module posh-git -Scope CurrentUser
Install-Module oh-my-posh -Scope CurrentUser

设置Profile脚本

if (!(Test-Path -Path $PROFILE )) { New-Item -Type File -Path $PROFILE -Force }
notepad $PROFILE

关闭脚本禁用:允许Powershell运行脚本

set-executionpolicy remotesigned

安装个性化字体,支持特殊符号

https://github.com/adam7/delugia-code/releases/download/v1910.04.1/Delugia.Nerd.Font.Complete.ttf

Terminal设置

// This file was initially generated by Windows Terminal 1.10.2714.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",

    "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":
        {
        // Make changes here to the powershell.exe profile.
        "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
        "name": "Windows PowerShell",
        "commandline": "powershell.exe",
        "hidden": false,

        },
        "list":
        [
            {
                // Make changes here to the powershell.exe profile.
                "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
                "name": "Windows PowerShell",
                "commandline": "powershell.exe",
                "hidden": false,
                "colorScheme":"BirdsOfParadise",       //引用:"schemes":"name": "Banana Blueberry"
                "backgroundImage": "C:\\Users\\kt211\\Pictures\\Camera Roll\\4d50f6b96cc7082224f03772d3530b20.jpg",
                "backgroundImageOpacity": 0.3,
                "backgroundImageStretchMode":"uniformToFill",   // 有四个选项 uniformToFill | none | fill | uniform
                "useAcrylic": false,                            // 是否显示背后的纹理
                "fontWeight": "normal",                         // 字体粗细
                "cursorColor": "#E6FF00",                       // 光标颜色
                "fontFace": "Delugia Nerd Font",                // 字体
                "fontSize": 10,                                 // 字体大小
            },
            {
                // Make changes here to the cmd.exe profile.
                "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
                "name": "命令提示符",
                "commandline": "cmd.exe",
                "hidden": false,
            },
            {
                "guid": "{c6eaf9f4-32a7-5fdc-b5cf-066e8a4b1e40}",
                "name": "Ubuntu-18.04",
                "source": "Windows.Terminal.Wsl",
                "colorScheme":"BirdsOfParadise",       //引用:"schemes":"name": "Banana Blueberry"
                "backgroundImage": "C:\\Users\\kt211\\Pictures\\Camera Roll\\4d50f6b96cc7082224f03772d3530b20.jpg",
                "backgroundImageOpacity": 0.3,
                "backgroundImageStretchMode":"uniformToFill",   // 有四个选项 uniformToFill | none | fill | uniform
                "useAcrylic": false,                            // 是否显示背后的纹理
                "fontWeight": "normal",                         // 字体粗细
                "cursorColor": "#E6FF00",                       // 光标颜色
                "fontFace": "Delugia Nerd Font",                // 字体
                "fontSize": 10,                                 // 字体大小

            },
            {
                "guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b7}",
                "hidden": false,
                "name": "git bash",
                "commandline": "D:\\Git\\bin\\bash.exe",

            },
        ]
    },

    // Add custom color schemes to this array.
    // To learn more about color schemes, visit https://aka.ms/terminal-color-schemes
    "schemes": [
        {
            "name": "BirdsOfParadise",
            "black": "#573d26",
            "red": "#be2d26",
            "green": "#6ba18a",
            "yellow": "#e99d2a",
            "blue": "#5a86ad",
            "purple": "#ac80a6",
            "cyan": "#74a6ad",
            "white": "#e0dbb7",
            "brightBlack": "#9b6c4a",
            "brightRed": "#e84627",
            "brightGreen": "#95d8ba",
            "brightYellow": "#d0d150",
            "brightBlue": "#b8d3ed",
            "brightPurple": "#d19ecb",
            "brightCyan": "#93cfd7",
            "brightWhite": "#fff9d5",
            "background": "#2a1f1d",
            "foreground": "#e0dbb7",
            "cursorColor": "#573d26",
            "selectionBackground": "#563c27",    
        }
    ],

    // Add custom actions and keybindings to this array.
    // To unbind a key combination from your defaults.json, set the command to "unbound".
    // To learn more about actions and keybindings, visit https://aka.ms/terminal-keybindings
    "actions":
    [
        // 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" }
    ]
}

sed 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” }
]
}


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值