WindowsTerminal折腾记
背景
Windows Terminal最近出了1.0版本,界面非常美观,但要配置好还是要下一番功夫,而且网上的教程都是互相抄,所以特将我的配置过程记录如下。
字体
首先是字体,默认字体英文不错,但中文挺不好看的,而Windows Terminal不支持单字节字符和双字节字符配置不同的字体,所以我找到了一个合成字体的网站,将英文的Consolas字体和和中文的楷体合并成了一个字体,然后双击安装。在配置文件的defaults标签下修改fontFace为字体的名字,fontSize为字体的大小,这是使用了合成字体的界面:
背景图片
接着是背景图片,在配置文件的defaults标签下添加如下属性:
"backgroundImage": "D:\\images\\image.jpg",
"backgroundImageOpacity": 0.2,
"backgroundImageStretchMode": "uniformToFill",
第一个属性是路径,第二个是透明度,第三个是拉伸方式,拉伸方式有四种取值,可以参考微软官方文档,建议使用uniformToFill,它能在保持图片分辨率的同时将图片拉伸充满窗口。
主题
Windows Terminal自带可以更换的主题可以在官方github上面看到,因为我的背景图是暖色调的,所以我选择了Solarized Light这一主题,不过使用该主题会造成一些地方的颜色看不太清楚,比如此主题下运行vim的查找字符串高亮显示背景和文字的颜色就过于接近,看不清楚;我所使用的文件管理器vifm的当前行高亮也看不太清楚,PowerShell的一些字符也被背景掩盖,所以需要自己修改一下。这是我自己定制的Solarized Light主题:
{
"name": "My Solarized Light",
"black": "#073642",
"red": "#dc322f",
"green": "#859900",
"yellow": "#b58900",
"blue": "#268bd2",
"purple": "#d33682",
"cyan": "#2aa198",
"white": "#eee8d5",
"brightBlack": "#002b36",
"brightRed": "#cb4b16",
"brightGreen": "#586e75",
"brightYellow": "#657b83",
"brightBlue": "#9ce3f8",
"brightPurple": "#6c71c4",
"brightCyan": "#859595",
"brightWhite": "#fae7b3",
"background": "#fdf6e3",
"foreground": "#657b83"
}
修改了brightBlue和brightCyan属性,同时将cursorColor属性改成了#657b83使得光标文字保持同个颜色,这个属性既可以出现在主题中也可以出现在前面的全局配置中,我放在前面了。如果还有显示不清楚的地方,可以用QQ的截图功能对想要修改的颜色区域进行取色,切换成十六进制后在主题中查找它对应的属性名然后修改。
以上可以解决各种程序的显示不清楚问题,但Powershell的问题本质上是Powershell语法高亮的问题,和Windows Terminal的主题无关,所以需要在PowerShell的配置文件里面修改。进入PowerShell,运行gvim $profile(gvim可以改成notepad等编辑器),然后输入下面的命令,保存退出:
Set-PSReadLineOption -Colors @{
Number = 'DarkBlue'
Member = 'DarkBlue'
} -EditMode 'Vi'
其中将Number和Member这两个token的颜色改成蓝色,因为原来的颜色就是黄色,和Solarized Light的背景颜色混起来看不清楚,如果还有显示不清楚的token,可以参考MSDN进行修改,editmode参数的修改属于我的个人喜好,Emacs党可以把Vi换成Emacs,都不是的就去掉这个参数即可。
完整配置
// This file was initially generated by Windows Terminal 1.0.1401.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": "{0a920985-e2e7-4fe2-8610-f29c814c920a}",
// 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": true,
// If enabled, formatted data is also copied to your clipboard
"copyFormatting": true,
"initialRows": 25,
"initialCols": 80,
// 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":
{
// Put settings here that you want to apply to all profiles.
"fontFace": "KaiConsolas",
"fontSize": 16,
"cursorShape": "filledBox",
"cursorColor": "#657b83",
"backgroundImage": "D:\\images\\image.jpg",
"backgroundImageOpacity": 0.2,
"colorScheme": "My Solarized Light"
},
"list":
[
{
// Make changes here to the powershell.exe profile.
"guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"name": "Windows PowerShell",
"commandline": "powershell.exe",
"hidden": false
},
{
"guid": "{0a920985-e2e7-4fe2-8610-f29c814c920a}",
"hidden": false,
"name": "Vifm",
"commandline": "D:\\Apps\\vifm-w64-se-0.10.1-binary\\vifm.exe",
"startingDirectory" : "D:\\"
},
{
// Make changes here to the cmd.exe profile.
"guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
"name": "命令提示符",
"commandline": "cmd.exe",
"hidden": false
},
{
"guid": "{2c4de342-38b7-51cf-b940-2309a097f518}",
"hidden": false,
"name": "Ubuntu",
"source": "Windows.Terminal.Wsl"
},
{
"guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}",
"hidden": false,
"name": "Azure Cloud Shell",
"source": "Windows.Terminal.Azure"
}
]
},
// Add custom color schemes to this array.
// To learn more about color schemes, visit https://aka.ms/terminal-color-schemes
"schemes": [
{
"name": "My Solarized Light",
"black": "#073642",
"red": "#dc322f",
"green": "#859900",
"yellow": "#b58900",
"blue": "#268bd2",
"purple": "#d33682",
"cyan": "#2aa198",
"white": "#eee8d5",
"brightBlack": "#002b36",
"brightRed": "#cb4b16",
"brightGreen": "#586e75",
"brightYellow": "#657b83",
"brightBlue": "#9ce3f8",
"brightPurple": "#6c71c4",
"brightCyan": "#859595",
"brightWhite": "#fae7b3",
"background": "#fdf6e3",
"foreground": "#657b83"
}
],
// 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":
[
// 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" }
]
}
WindowsTerminal折腾记的更多相关文章
- 斐讯N1折腾记
斐讯N1折腾记:运行 Linux 及优化 2018-06-23 37条评论 4,445次阅读 11人点赞 最后更新时间:2019年03月10日 咳咳咳,上篇教程教大家给斐讯 N1 降级并且刷了 ...
- Atom编辑器折腾记
http://blog.csdn.net/bomess/article/category/3202419/2 Atom编辑器折腾记_(1)介绍下载安装 Atom编辑器折腾记_(2)基础了解使用 Ato ...
- BeagleBone折腾记(一):连接你的狗板
BeagleBone折腾记一连接你的狗板 准备 了解BeagleBone BeagleBone社区 所需软硬件 USB连接 TTL连接 结语 准备 了解BeagleBone BeagleBone可能一 ...
- Vue折腾记 - (3)写一个不大靠谱的typeahead组件
Vue折腾记 - (3)写一个不大靠谱的typeahead组件 2017年07月20日 15:17:05 阅读数:691 前言 typeahead在网站中的应用很多..今天跟着我来写一个不大靠谱的ty ...
- Anaconda折腾记(1)
Anaconda折腾记 谨此记录小白的我在Anaconda里面的摸爬滚打 更换更新源 可以不使用命令,直接进入C盘,进入user文件夹,进入当前的用户文件夹下,记得显示隐藏文件. 找到.condarc ...
- FreeBSD jail 折腾记(二)
FreeBSD jail 折腾记(二) 创建jail目录 创建4个 分别是模板 骨架 数据 项目 创建模板目录 mkdir -p /jail/j1 # 然后放入基本目录,上篇说过不再写 创建骨架目录 ...
- 【转载】有图 KVM折腾记..
KVM折腾记...https://lengjibo.github.io/KVM%E6%8A%98%E8%85%BE%E8%AE%B0/ Veröffentlicht am 2018-09-20 | ...
- Android编译环境折腾记
题记:感觉是时候写点什么了=_=! 第一次安装了ubuntu14.04.5,官网下载的iso,官网下的jar,编译android4.x需要安装jdk6,更高的版本会有问题,baidu到很多搭建环境的步 ...
- 【树莓派】【转载】Raspberry Pi (树莓派)折腾记
在网上看到一篇对树莓派折腾记录比较详细的文章,时间比较早,但是有些东西没变. 对于新手而言,还是有点参考价值.文章参见:http://skypegnu1.blog.51cto.com/8991766/ ...
随机推荐
- Node.js躬行记(4)——自建前端监控系统
这套前端监控系统用到的技术栈是:React+MongoDB+Node.js+Koa2.将性能和错误量化.因为自己平时喜欢吃菠萝,所以就取名叫菠萝系统.其实在很早以前就有这个想法,当时已经实现了前端的参 ...
- Python中和迭代有关的两个函数next()和iter()
next(): next()返回迭代器的下一个项目 next语法: next(iterator[,dafault]) iterator -- 可迭代对象 default -- 可选,用于设置在没有下一 ...
- 1、python简介-变量-注释-数据类型-用户交互-if语句-while循坏
一. 计算机是什么 基本组成: 主板+cpu+内存 cpu: 主频, 核数(16) 内存:大小(8G, 16G, 32G) 型号: DDR3, DDR4, DDR5, 主频(海盗船,玩家国度) 显卡: ...
- SSM-框架搭建-tank后台学习系统
一.前言 最近收到很多网友给我私信,学习软件开发有点吃力,不知道从何处开始学习,会点基础但是做不出来什么项目, 都想放弃了.我就回复道:当下互联网飞速发展,软件开发行业非常吃香而且前景相当不错.希望能 ...
- 【Python】使用Selenium实现淘宝抢单
最近,小明为了达成小姐姐的愿望,在某宝买到心仪的宝贝,再加上又迷上了python,就通过python轻而易举地实现了(个人声明:对Java来说,这并不是背叛). 需求分析&前期准备 需求其实很 ...
- spring boot admin 源码包的编译
https://github.com/codecentric/spring-boot-admin 下载地址: 编译要求: Build Requirements: Node.js v8.x (LTS) ...
- 防火墙识别、负载均衡识别、waf识别
防火墙识别: 通过发送SYN和ACK数据包并分析回包可以大概判断端口是否被防火墙过滤,对应关系如下表: Python代码实现: #!/usr/bin/python from scapy.all imp ...
- Day12-微信小程序实战-交友小程序-搭建服务器与上传文件到后端
要搞一个小型的cms内容发布系统 因为小程序上线之后,直接对数据库进行操作的话,慧出问题的,所以一般都会做一个管理系统,让工作人员通过这个管理系统来对这个数据库进行增删改查 微信小程序其实给我们提供了 ...
- 【Spring注解驱动开发】BeanPostProcessor在Spring底层是如何使用的?看完这篇我懂了!!
写在前面 在<[String注解驱动开发]面试官再问你BeanPostProcessor的执行流程,就把这篇文章甩给他!>一文中,我们详细的介绍了BeanPostProcessor的执行流 ...
- StringBuider 在什么条件下、如何使用效率更高?
声明:本文首发于博客园,作者:后青春期的Keats:地址:https://www.cnblogs.com/keatsCoder/ 转载请注明,谢谢! 引言 都说 StringBuilder 在处理字符 ...