作为一个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. Python3中正则的贪婪匹配模式

    什么是贪婪模式 正则在进行匹配时,从开始位置查找最远的结束位置,这种模式称之为贪婪模式. 在进行HTML标签类似内容获取时,贪婪模式会导致整个内容的返回,需要使用非贪婪模式. 固定的书写规则 : .* ...

  2. (二)Redis在Mac下的安装与SpringBoot中的配置

    1 下载Redis 官网下载,下载 stable 版本,稳定版本. 2 本地安装 解压:tar zxvf redis-6.0.1.tar.gz 移动到: sudo mv redis-6.0.1 /us ...

  3. SAP登录消息提醒

      1功能说明 在相应用户登录时,给其提示相关信息. 2功能实现 2.1函数实现 在函数NAVIGATION_SET_START_TCODE中注册要监听的用户和程序的事务代码,当用户登录时,将自动运行 ...

  4. Java UDP小结

    UDP: * 发送端                                                                                           ...

  5. [codeforces-543-D div1]树型DP

    题意:给一棵树的边标上0或1,求以节点i为源点,其它点到i的唯一路径上的1的边数不超过1条的方案数,输出所有i的答案. 思路:令f[i]表示以节点i为源点,只考虑子树i时的方案数,ans[i]为最后答 ...

  6. Git、Github习笔记01——Git本地仓库

    作者:Eventi 出处:http://www.cnblogs.com/Eventi 欢迎转载,也请保留这段声明.谢谢! git简介 版本控制软件,由Linus(linux开发者)开发,最初用来对li ...

  7. 安装laravel环境之homestead(for mac)

    1.先下载virtualbox + vagrant 2.执行命令 vagrant box add laravel/homestead 3.新建一个空文件夹,在里面下载代码.我是放在当前用户下的新建的W ...

  8. 一个排查了大半天儿的问题,差点又让 MyBatis 背锅

    我是风筝,公众号「古时的风筝」,一个不只有技术的技术公众号,一个在程序圈混迹多年,主业 Java,另外 Python.React 也玩儿的 6 的斜杠开发者. Spring Cloud 系列文章已经完 ...

  9. 「雕爷学编程」Arduino动手做(32)——雨滴传感器模块

    37款传感器与模块的提法,在网络上广泛流传,其实Arduino能够兼容的传感器模块肯定是不止37种的.鉴于本人手头积累了一些传感器和模块,依照实践出真知(一定要动手做)的理念,以学习和交流为目的,这里 ...

  10. 学习Echarts:(二)异步加载更新

    这部分比较简单,对图表的异步加载和更新,其实只是异步获取数据然后通过setOption传入数据和配置而已. $.get('data.json').done(function (data) { myCh ...