作为一个Windows的长期用户,一直没有给款好用的终端,知道遇到了 cmder,它拯救一个习惯用Windows敲shell命令的人。

不用跟我安利macOS真香!公司上班一直用macOS,一方面确实更加习惯windows下面学习, 另一方面是上课需要Windows QQ共享桌面。

windows Terminal 1.0发布,那么是时候和 cmder 说再见了。

不过需要做一些配置和美化。

美化主题

  • 安装posh-git和oh-my-posh
> Install-Module posh-git -Scope CurrentUser
> Install-Module oh-my-posh -Scope CurrentUser
  • 启用默认设置
> Set-Prompt
  • 设置主题:
> Set-Theme Sorin

oh-my-posh 支持十几种主题:

> Set-Theme

位于命令管道位置 1 的 cmdlet Set-Theme
请为以下参数提供值:
name: ? 警告: Theme ? not found. Available themes are: Name Type Location
---- ---- --------
Agnoster Defaults C:\Users\fnngj\Documents\WindowsPowerShell\Modules\oh-my-posh\2.0.412\Themes\Agnoster...
AgnosterPlus Defaults C:\Users\fnngj\Documents\WindowsPowerShell\Modules\oh-my-posh\2.0.412\Themes\Agnoster...
Avit Defaults C:\Users\fnngj\Documents\WindowsPowerShell\Modules\oh-my-posh\2.0.412\Themes\Avit.psm1
Darkblood Defaults C:\Users\fnngj\Documents\WindowsPowerShell\Modules\oh-my-posh\2.0.412\Themes\Darkbloo...
Fish Defaults C:\Users\fnngj\Documents\WindowsPowerShell\Modules\oh-my-posh\2.0.412\Themes\Fish.psm1
Honukai Defaults C:\Users\fnngj\Documents\WindowsPowerShell\Modules\oh-my-posh\2.0.412\Themes\Honukai....
Paradox Defaults C:\Users\fnngj\Documents\WindowsPowerShell\Modules\oh-my-posh\2.0.412\Themes\Paradox....
Powerlevel10k-Classic Defaults C:\Users\fnngj\Documents\WindowsPowerShell\Modules\oh-my-posh\2.0.412\Themes\Powerlev...
Powerlevel10k-Lean Defaults C:\Users\fnngj\Documents\WindowsPowerShell\Modules\oh-my-posh\2.0.412\Themes\Powerlev...
PowerLine Defaults C:\Users\fnngj\Documents\WindowsPowerShell\Modules\oh-my-posh\2.0.412\Themes\PowerLin...
pure Defaults C:\Users\fnngj\Documents\WindowsPowerShell\Modules\oh-my-posh\2.0.412\Themes\pure.psm1
robbyrussell Defaults C:\Users\fnngj\Documents\WindowsPowerShell\Modules\oh-my-posh\2.0.412\Themes\robbyrus...
Sorin Defaults C:\Users\fnngj\Documents\WindowsPowerShell\Modules\oh-my-posh\2.0.412\Themes\Sorin.psm1
tehrob Defaults C:\Users\fnngj\Documents\WindowsPowerShell\Modules\oh-my-posh\2.0.412\Themes\tehrob.psm1
  • 使用记事本打开PS配置文件(如无则创建该文件)
> if (!(Test-Path -Path $PROFILE )) { New-Item -Type File -Path $PROFILE -Force } notepad $PROFILE

随后,在打开的记事本窗口里,在文末加入下面内容,以让Powershell在启动之时应用主题,然后保存。(仅对当前用户生效)

Import-Module posh-git
Import-Module oh-my-posh
Set-Theme Sorin

设置字体

如果你设置的主题出现乱码,可以安装SarasaGothic字体库。

> scoop bucket add nerd-fonts
> scoop install SarasaGothic

或者直接到github下载:

https://github.com/be5invis/Sarasa-Gothic/releases

然后,将字体库解压 复制到 C:\Windows\Font\ 目录。

Windows Terminal 设置

点击 Windows Terminal 向下箭头,选择设置,将会找打开一个配置文件。

// 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": "{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": {
// Put settings here that you want to apply to all profiles.
"fontFace": "Sarasa Term Slab SC", // 选择字体,前面安装的
"backgroundImage" : "C:/Users/fnngj/Pictures/bg.jpg", // 设置背景图片
"backgroundImageOpacity" : 0.9, // 背景图片透明度
"fontSize" : 16, // 字体大小
"foreground": "#76EE00" //字体颜色
},
//...

当然,你也可以在继续安装vim 工具,来更加符合你的 shell习惯。

是时候扔掉cmder, 换上Windows Terminal的更多相关文章

  1. Windows Terminal 安装及美化

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

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

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

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

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

  4. 终于等到你!微软正式上线 Windows Terminal 预览版

    前一段时间,一直在知乎.技术社区收到技术小伙伴们的终极拷问:微软Build 大会上提到的**6月中旬**要上Windows store 的 Windows Terminal 到底啥时候可以用到呀? 有 ...

  5. Windows Store可以下载安装Windows Terminal (Preview)

    Windows Terminal (Preview)已经可以在Windows Store下载安装. Windows Terminal (Preview)运行要求为: Windows 10 版本 183 ...

  6. windows linux 子系统及windows terminal的使用。

    windows linux 子系统及windows terminal的使用. windows linux (wsl) 其实windows早就为我们准备好了子系统,但是我们的应用商店经常挂掉.因此都用不 ...

  7. Windows Terminal (Preview)治好了cmd,powershell的癌症

    前言 话说n年前,我想开发一款powershell麻将游戏,但是发现命令行下无法显示麻将牌这种特殊符号. 经过研究发现,这是4字节的utf16le字符串.而powershell依赖的渲染引擎,只能渲染 ...

  8. 提前体验让人"回归Windows怀抱"的Windows Terminal

    前言 在一年一度的微软开发者大会Build 2019登场的Windows Terminal饱受好评,大家对其也是充满了兴趣和热情,程序员的朋友圈都被微软发布的最新终端 windows Terminal ...

  9. Windows Terminal Preview v0.7 Release

    Windows Terminal Preview v0.7 Release The following key bindings are included by default within this ...

随机推荐

  1. 学习vue第五节,vue中使用class和style的css样式

    vue中使用class样式 数组 <h1 :class="['red', 'thin']">这是一个H1</h1> 数组中使用三元表达式 <h1 :c ...

  2. 2020 wannafly camp 补题 day1

    题目可以从牛客上找到. 最简单的一个题应该是B B. 密码学 这个应该就是倒着推,题目给了你加密的顺序,所以我们逆推这个就可以得到每一次加密前的字符串. 1H. 最大公约数 题目大意就是给你一个范围1 ...

  3. php接口开发经验总结

    接口开发采用jwt方式验证: 接口开发最好留多几个返回方式,方便本地调用: 待更新.............

  4. 流媒体与实时计算,Netflix公司Druid应用实践

    Netflix(Nasdaq NFLX),也就是网飞公司,成立于1997年,是一家在线影片[租赁]提供商,主要提供Netflix超大数量的[DVD]并免费递送,总部位于美国加利福尼亚州洛斯盖图.199 ...

  5. 【HBase】底层原理

    目录 系统架构 表数据模型 物理存储 系统架构 在文章[HBase]基本介绍和基础架构中已经有简单介绍 Client -- 包含访问hbase的接口,client维护着一些cache来加快对hbase ...

  6. Arrays.binarySearch的返回值

    如果查找的值包含在数组中,返回搜索的第一个值的下标: 如果查找的值不在数组中,返回(-插入点-1):插入点即为第一个大于此查找值的元素下标 插入点 为将该值插入数组的那一点:即第一个大于此键的元素下标 ...

  7. JDBC04 PreparedStatement

    PreparedStatement类 存在预编译,用占位符去填参数(参数索引从1开始算),可以防止SQL注入 try { Class.forName("com.mysql.cj.jdbc.D ...

  8. 暴力破解-HTTP Basic认证

    0x01 HTTP Basic认证介绍 基本认证 basic authentication ← HTTP1.0提出的认证方法 基本认证步骤: 1. 客户端访问一个受http基本认证保护的资源. 2. ...

  9. FF按钮点击后表单提交

    如果发现<button>提交</button>点击后,所在的表单在ff中自动提交了,则需要添加属性 type='button'! 我也是百度的,记在这里以后方便查看!

  10. rabbitMQ基于spring-rabbitnq

    一.什么是MQ MQ全称为Message Queue,消息队列(MQ)是一种应用程序对应用程序的通信方法.应用程序通过读写出入队列的消息(针对应用程序的数据)来通信,而无需专用连接来链接它们.消息传递 ...