Windows Terminal安装并美化
介绍
Windows Teminal是一款新式、快速、高效、强大的终端应用程序,适用于命令行工具、命令提示符、PowerShell、WSL(Linux子系统)等等的Shell用户,主要功能包括多选项卡、窗格、Unicode/UTF-8字符支持、GPU 加速文本渲染引擎,以及自定义主题、样式和配置等等。
Github地址:https://github.com/microsoft/terminal
官网下载地址:https://www.microsoft.com/zh-cn/p/windows-terminal/9n0dx20hk701?activetab=pivot:overviewtab
安装Windows Terminal
打开Microsoft Store,搜索Windows Teminal并安装。

启动:

安装最新版本PowerShell
Widows 10 默认是 Windows PowerShell 是 5.X 版本,在 Win10 V1903 以上版本后,打开 PowerShell 时,会提示 “尝试新的跨平台 PowerShell https://aka.ms/pscore6” ,打开提示网址。
下载地址:https://github.com/PowerShell/PowerShell/releases
选择PowerShell-<version>-win-<os-arch>.msi格式的安装包:

下载后,双击安装程序并按照提示进行操作。
安装程序在 Windows“开始”菜单中创建一个快捷方式。
- 默认情况下,包安装位置为
$env:ProgramFiles\PowerShell\ - 可以通过“开始”菜单或
$env:ProgramFiles\PowerShell\\pwsh.exe启动 PowerShell
PowerShell 7 安装到新目录,并与 Windows PowerShell 5.1 并行运行。 对于 PowerShell Core 6.x,PowerShell 7 是删除 PowerShell Core 6.x 的就地升级。
- PowerShell 7 安装到
$env:ProgramFiles\PowerShell\7 $env:ProgramFiles\PowerShell\7文件夹已添加到$env:PATH$env:ProgramFiles\PowerShell\6文件夹已删除
如果需要与 PowerShell 7 并行运行 PowerShell 6,请使用 ZIP 安装方法重新安装 PowerShell 6。
查看版本,在命令行窗口中输入命令
$PSVersionTable.PSVersion
美化Windows Terminal
参考:https://docs.microsoft.com/zh-cn/windows/terminal/
默认会话为Power Shell 5.x版本,将之修改为7
"defaultProfile":的值改为"source": "Windows.Terminal.PowershellCore"的guid即可,例如它的guid为"{574e775e-4f2a-5b96-ac1e-a2962a402336}"。
"defaultProfile": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
schemes配置
{
"name": "Snazzy",
"black": "#000000",
"red": "#fc4346",
"green": "#50fb7c",
"yellow": "#f0fb8c",
"blue": "#49baff",
"purple": "#fc4cb4",
"cyan": "#8be9fe",
"white": "#ededec",
"brightBlack": "#555555",
"brightRed": "#fc4346",
"brightGreen": "#50fb7c",
"brightYellow": "#f0fb8c",
"brightBlue": "#49baff",
"brightPurple": "#fc4cb4",
"brightCyan": "#8be9fe",
"brightWhite": "#ededec",
"background": "#1e1f29",
"foreground": "#ebece6"
}
毛玻璃主题
若喜欢毛玻璃主题,可以在"profiles"内加入以下两个参数:
- useAcrylic:如果设置为
true,窗口将使用acrylic背景。 设置为false时,窗口将为普通的、不带纹理的背景。默认值为false。 - acrylicOpacity:将
useAcrylic设置为true时,这会设置该配置文件的窗口透明度。 接受的浮点值为0-1。默认值为0.5。
效果如下:

安装oh-my-posh
Github地址:https://github.com/JanDeDobbeleer/oh-my-posh
安装 posh-git 和 oh-my-posh
Install-Module posh-git -Scope CurrentUser
Install-Module oh-my-posh -Scope CurrentUser
Install-Module DirColors
设置 Powershell 的 profile
if (!(Test-Path -Path $PROFILE )) { New-Item -Type File -Path $PROFILE -Force }
notepad $PROFILE
粘贴以下内容进 profile 文件
Import-Module posh-git
Import-Module oh-my-posh
Import-Module DirColors
主题颜色美化
安装colortool
scoop install colortool
查看颜色方案
colortool -s
设置颜色:
colortool OneHalfDark.itermcolors
Power Shell 7美化
Power Shell 7的配置:
{
"guid": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
"hidden": false,
"name": "PowerShell",
"source": "Windows.Terminal.PowershellCore",
"colorScheme" : "Snazzy",
"startingDirectory": "E:\\",
"fontFace" : "Cascadia Code PL",
"cursorColor" : "#000000"
}
显示效果如下:


ubuntu美化
Ubuntu的配置:
{
"guid": "{07b52e3e-de2c-5db4-bd2d-ba144ed6c273}",
"hidden": false,
"name": "Ubuntu-20.04",
"colorScheme" : "Snazzy",
"startingDirectory": "E:\\code",
"source": "Windows.Terminal.Wsl"
},
修改命令提示符,修改root用户的~/.bashrc文件:
export PS1='\[\e[31;1m\][\u\[\e[37;1m\]@\[\e[34;1m\]\H \W]\[\e[35;1m\]\$ \[\e[0m\]'
新建/etc/profile.d/ps1.sh
export PS1='\[\e[36;1m\][\u\[\e[33;1m\]@\[\e[35;1m\]\H \W]\[\e[34;1m\]\$ \[\e[0m\]'
新建/etc/profile.d/alias.sh
alias cp='cp -i'
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
alias grep='grep --color=auto'
alias l.='ls -d .* --color=auto'
alias ll='ls -l --color=auto'
alias ls='ls --color=auto'
alias mv='mv -i'
alias rm='rm -i'
alias which='(alias; declare -f) | /usr/bin/which --tty-only --read-alias --read-functions --show-tilde --show-dot'
alias xzegrep='xzegrep --color=auto'
alias xzfgrep='xzfgrep --color=auto'
alias xzgrep='xzgrep --color=auto'
alias zegrep='zegrep --color=auto'
alias zfgrep='zfgrep --color=auto'
alias zgrep='zgrep --color=auto'
显示效果如下:

Windows Terminal安装并美化的更多相关文章
- Windows Terminal 安装及美化
windows terminal 是今年微软Build大会上推出的一款的全新终端,用来代替cmder之类的第三方终端.具有亚克力透明.多标签.Unicode支持(中文,Emoji).自带等宽字体等这些 ...
- Windows Terminal 安装与配置
1 安装 安装可以从应用商店安装(直接搜索即可)或者Github安装(可以戳这里): 下载msixbundle格式的文件即可直接打开安装. 2 配置前准备 2.1 下载字体 推荐使用FiraCode, ...
- Windows Terminal 新手入门
翻译自 Kayla Cinnamon 2020年12月17日的文章<Getting Started with Windows Terminal> [1] 安装 Windows Termin ...
- 黑科技抢先尝(续2) - Windows terminal中Powershell Tab的极简美化指南
目录 安装python 安装git 安装powerline字体 主题定制 安装oh-my-posh 查看策略组的执行权限 使用choco 安装终端模拟器 - ConEmu 优化 PowerShell ...
- 黑科技抢先尝(续) - Windows terminal中WSL Linux 终端的极简美化指南
目录 修改默认源,为apt-get安装提速 安装python 和 python pip 安装 zsh 安装powerline-font中的特定字体 安装powerline-shell 修改~目录下的配 ...
- Windows10上安装Linux子系统(WSL2,Ubuntu),配合Windows Terminal使用
Linux 的 Windows 子系统可让开发人员按原样运行 GNU/Linux 环境 - 包括大多数命令行工具.实用工具和应用程序 - 且不会产生传统虚拟机或双启动设置开销. WSL 说白了安装Li ...
- 深入浅出,遇见Windows Terminal(Windows终端器),体验及美化新一代终端神器
Windows Terminal 简介 Windows Terminal is a new, modern, feature-rich, productive terminal application ...
- Windows Terminal 美化教程
Windows Terminal 美化教程 1.安装Windows Terminal 在微软商店搜索Windows Terminal下载即可 2.安装相应的插件 使用管理员权限打开Windows Te ...
- 使用 oh-my-posh 美化 windows terminal,让其接近oh-my-zsh
本文旨在快速让你进行美化,少踩一些坑,原文出自我的博客:prettier-windows-terminal-with-oh-my-posh 为了同 iterm2 下的 oh-my-zsh 保持基本一致 ...
随机推荐
- OpenCV学习(1)——初步接触
一.介绍OpenCV OpenCV的全称是Open Source Computer Vision Library,是一个跨平台的计算机视觉库.OpenCV是由英特尔公司发起并参与开 ...
- build.gradle 详解(一)
简述: 1) Java 开发中有两个大名鼎鼎的项目构建 ANT.Maven. 2) Google 推荐使用的 Android studio 是采用 Gradle 来构建项目.Gradle 是一个非常先 ...
- jQuery动态时钟
效果图: 引用的jQuery.js自己百度 代码: <!DOCTYPE html> <html> <head> <meta charset="utf ...
- 自定义Bootstrap样式弹出框
最近做的一些功能需要用到Bootstrap,然而原来的系统并没有引入Bootstrap,为了新写的控件能够应用于老的页面,又不需要在老的页面上引入全套的Bootstrap文件决定写一个模仿Bootst ...
- INTERVIEW #5
笔试 150min,3题,每题100分,自己果然还是个蒟蒻呢~ 最近状态好差,虽然做了一些题,但还是考得稀烂,大概有几点需要加强: 独立做题,不要一边看板子一边写代码,更不要一开始就看题解: 对之前研 ...
- 瑞幸咖啡还是星巴克,一杯下午茶让我明白 设计模式--模板方法模式(Template Method Pattern)
简介 Define the skeleton of an algorithm in an operation,deferring some steps to subclasses.Template M ...
- 背英语单词很困难,不妨学习一下词根词缀吧(每天10个词根、词缀)Part 3
1.ir- 不,向内 例词: irregular=ir(不)-regular(规则的)=不规则的 irrigate=ir(向内)-rigate(浇水)=灌溉 2. kilo- 千 例词: kilogr ...
- Java采用反射技术创建对象后对目标类的成员变量和成员方法进行访问
实现: package com.ljy; import java.lang.reflect.Field; import java.lang.reflect.Method; /** * * @Class ...
- 线段树 区间加 gcd 差分 小阳的贝壳
小阳的贝壳 如果线段树要维护区间gcd 这个很简单,但是如果有了区间加,维护gcd 就比较麻烦了. 这个首先可以证明的是 gcd(x,y,z)=gcd(x,y-x,z-y) 这个可以推到 n 个 ...
- CSS 块元素、内联元素、内联块元素三者的区别与转换
三种元素 块元素 内联元素 内联块元素 元素之间的转换 三种元素 元素就是标签,布局中常用的有三种标签,块元素.内联元素.内联块元素. 了解这三种元素的特性,才能熟练的进行页面布局. 块元素 块元素, ...