介绍

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安装并美化的更多相关文章

  1. Windows Terminal 安装及美化

    windows terminal 是今年微软Build大会上推出的一款的全新终端,用来代替cmder之类的第三方终端.具有亚克力透明.多标签.Unicode支持(中文,Emoji).自带等宽字体等这些 ...

  2. Windows Terminal 安装与配置

    1 安装 安装可以从应用商店安装(直接搜索即可)或者Github安装(可以戳这里): 下载msixbundle格式的文件即可直接打开安装. 2 配置前准备 2.1 下载字体 推荐使用FiraCode, ...

  3. Windows Terminal 新手入门

    翻译自 Kayla Cinnamon 2020年12月17日的文章<Getting Started with Windows Terminal> [1] 安装 Windows Termin ...

  4. 黑科技抢先尝(续2) - Windows terminal中Powershell Tab的极简美化指南

    目录 安装python 安装git 安装powerline字体 主题定制 安装oh-my-posh 查看策略组的执行权限 使用choco 安装终端模拟器 - ConEmu 优化 PowerShell ...

  5. 黑科技抢先尝(续) - Windows terminal中WSL Linux 终端的极简美化指南

    目录 修改默认源,为apt-get安装提速 安装python 和 python pip 安装 zsh 安装powerline-font中的特定字体 安装powerline-shell 修改~目录下的配 ...

  6. Windows10上安装Linux子系统(WSL2,Ubuntu),配合Windows Terminal使用

    Linux 的 Windows 子系统可让开发人员按原样运行 GNU/Linux 环境 - 包括大多数命令行工具.实用工具和应用程序 - 且不会产生传统虚拟机或双启动设置开销. WSL 说白了安装Li ...

  7. 深入浅出,遇见Windows Terminal(Windows终端器),体验及美化新一代终端神器

    Windows Terminal 简介 Windows Terminal is a new, modern, feature-rich, productive terminal application ...

  8. Windows Terminal 美化教程

    Windows Terminal 美化教程 1.安装Windows Terminal 在微软商店搜索Windows Terminal下载即可 2.安装相应的插件 使用管理员权限打开Windows Te ...

  9. 使用 oh-my-posh 美化 windows terminal,让其接近oh-my-zsh

    本文旨在快速让你进行美化,少踩一些坑,原文出自我的博客:prettier-windows-terminal-with-oh-my-posh 为了同 iterm2 下的 oh-my-zsh 保持基本一致 ...

随机推荐

  1. WebLogic上的项目无法更新,删除项目缓存

    /root/bea/user_projects/domains/base_domain/servers/AdminServer/tmp/ /root/bea/user_projects/domains ...

  2. C6 C7的开机启动流程

    C6开机启动流程 1.内核引导,加电自检(通电后检查内核):检查bios的配置,检测硬件 装好系统之后才会进行以下内容 MBR 引导 (3.2.1...) GRUB菜单 (选择不同的系统)(按e,进入 ...

  3. Visual Studio Code插件安装步骤

    1.进入扩展视图视图安装或卸载(快捷键Ctrl+shift+x) 转载于:https://www.cnblogs.com/SakalakaZ/p/7725159.html

  4. ASP.NET Core WebApi(01)项目建立

    前言:前一段时间学习了ASP.NET Core,决定写个简单的项目,旨在消化所学内容,并记录过程中遇到的问题.本章是第一篇,内容为项目的建立 一.准备工作 安装Visual Studio时,默认会安装 ...

  5. 动态规划经典算法--最长公共子序列 LCS

    转移方程 代码: //法一: #include <bits/stdc++.h> using namespace std; //---------------https://lunatic. ...

  6. 2019 ICPC 南京网络赛 H-Holy Grail

    As the current heir of a wizarding family with a long history,unfortunately, you find yourself force ...

  7. 01 微信小程序入门

    一. 小程序介绍 微信小程序是腾讯于2017年1月9日推出的一种不需要下载安装即可在微信平台上使用的应用,主要提供给企业.政府.媒体.其他组织或个人的开发者在微信平台上提供服务. 微信小程序和微信的原 ...

  8. Hadoop入门学习笔记-第二天 (HDFS:NodeName高可用集群配置)

    说明:hdfs:nn单点故障,压力过大,内存受限,扩展受阻.hdfs ha :主备切换方式解决单点故障hdfs Federation联邦:解决鸭梨过大.支持水平扩展,每个nn分管一部分目录,所有nn共 ...

  9. SAP ME01创建货源清单

    1业务说明 此文档使用函数:ME_DIRECT_INPUT_SOURCE_LIST创建货源清单 2前台实现 事务代码:ME01 输入抬头信息 保存即可 3代码实现 3.1调用函数 定义参数 字段 调用 ...

  10. Java元注解@Retention规则

    @Retention是java当中的一个元注解,该元注解通常都是用于对软件的测试 1.适用方式:     @Retention(RetentionPolicy.RUNTIME)     @interf ...