最终效果

首先安装Wsl2和Windows Terminal

Wsl2安装教程:https://docs.microsoft.com/zh-cn/windows/wsl/install-win10

Wsl2只是一个壳,里面需要装一个Linux系统,我选择的Ubuntu20.04, Microsoft Store商店下载地址 : https://www.microsoft.com/store/productId/9N6SVWS3RX71

Windows Termianal Microsoft Store商店下载地址商店下载地址:https://www.microsoft.com/store/productId/9N0DX20HK701

并在ubuntu20.04中完成zsh和oh-my-zsh的安装

sudo apt install zsh -y
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

然后改注册表

Win+R,并输入regedit,打开注册表

运行regedit

在注册表添加右键信息

路径 计算机\HKEY_CURRENT_USER\SOFTWARE\Classes\Directory\Background\shell\在此处打开WindowsTerminal\command

填入的信息 wt -d "%V%/"

打开Windows Terminal, 改setting

改Setting的目的是将defaultProfile字段的值改为Ubuntu20.04对应的guid

setting示例

// This file was initially generated by Windows Terminal 1.5.10271.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": "{07b52e3e-de2c-5db4-bd2d-ba144ed6c273}",// 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.},"list":[{// Make changes here to the powershell.exe profile."guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}","name": "Windows PowerShell","commandline": "powershell.exe","hidden": false},{"guid": "{07b52e3e-de2c-5db4-bd2d-ba144ed6c273}","hidden": false,"name": "Ubuntu-20.04","source": "Windows.Terminal.Wsl",},{// Make changes here to the cmd.exe profile."guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}","name": "命令提示符","commandline": "cmd.exe","hidden": false},{"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": [],// Add custom actions and keybindings to this array.// To unbind a key combination from your defaults.json, set the command to "unbound".// To learn more about actions and keybindings, visit https://aka.ms/terminal-keybindings"actions":[// 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" }]
}

如果重启电脑后,右键菜单自动出现了一个 Open in Windows Terminal ,功能和我们新增的右键功能一样,但又无法独立运作,建议去除它

  1. 通过组合键Windows+R,打开运行, 输入 regedit 打开注册表
  1. 打开 \HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked (如果Blocked不存在,则需要自己创建) 然后 新增 一个字符串类型的值 键设置为 {9F156763-7844-4DC4-B2B1-901F640F5155} 值设置为 WindowsTerminal
  1. 重启电脑,即可去除系统自动新增的右键菜单

参考资料

https://segmentfault.com/a/1190000037717476

http://bbs.pcbeta.com/forum.php?mod=viewthread&tid=1858613

https://github.com/microsoft/terminal/issues/7008

本文永久更新地址(欢迎来读留言,写评论):

https://www.v2fy.com/p/2021-02-10-zsh-win-1612954923000


http://www.taodudu.cc/news/show-3439892.html

相关文章:

  • ohmyzsh用在mysql_Linux 安装 zsh oh-my-zsh
  • StarCTF oh-my-bet
  • Linux终端美化工具(oh-my-zsh)
  • java文件的读和写还有使用_java中文件读和写的操作
  • *CTF2022 oh-my-notepro
  • dialogue怎么读_dialogue是什么意思
  • *CTF2022 oh-my-grafana
  • oh-my-notepro
  • 小米手环7替换太空人表盘
  • 项目一:《小米官网》
  • 仿写小米网站首页 中间部分
  • 小米穿戴更换表盘方法
  • 美媒评小米手环:设计简约 功能实用
  • 静态小米官网主页html5设计,web案例-css制作小米官网产品展示
  • Android 小米手环睡眠数据获取(MiFit同步到GoogleFit获取)总结
  • 小米手环6更换表盘方法(MIUI12.5,安卓11可用)太空人
  • 小米4硬改教程_小米手环3系列更换表盘教程
  • 小米手环NFC读不了卡_售价169元的小米手环4实测 开启你智能生活的第一把钥匙...
  • 用命令清理计算机,快速清理电脑垃圾用什么命令
  • 鸿蒙系统会和安卓一样垃圾多,“鸿蒙系统”和“安卓系统”到底有什么区别?网友:细节定成败!...
  • 华为鸿蒙系统含义,华为鸿蒙系统正在的意义
  • 树莓派初体验,超级便宜的服务器~
  • 老生常谈Java虚拟机垃圾回收机制(必看篇)
  • MeterSphere之系统设置
  • ubunut系统清理 删除无用缓存及垃圾文件
  • UBIFS文件系统
  • 关于C盘的Temp里的垃圾文件如何清理!
  • JAVA垃圾收集器之G1
  • 【Java】Java的垃圾回收机制小结
  • 用dos命令轻松删除Windows7系统中的垃圾文件

程序员福音!Win10下使用oh-my-zsh全攻略,让Win10开发更顺滑...相关推荐

  1. Windows 10 下C盘空间清理全攻略(Win10 C盘清理 )

    双击鼠标左键,打开"我的电脑" 2 选中"Windows(C:)",点击鼠标右键,在弹出的界面中点击"属性" 3 在弹出的界面中点击&quo ...

  2. Linux下Makefile的automake生成全攻略(转)

    Linux下Makefile的automake生成全攻略(转)[@more@] 文/余涛 作为Linux下的程序开发人员,大家一定都遇到过Makefile,用make命令来编译自己写的程序确实是很方便 ...

  3. 程序员的职业规划_从菜鸡到大佬——程序员们,请收下这份职业规划全攻略!...

    作者:阿诺,有删改 引言 John Z. Sonmez是一位来自硅谷的杰出程序员,2016年他出版了<软技能:代码之外的生存指南>一书.这本书在中国翻译出版之后,引起了国内广大程序员的热烈 ...

  4. attiny13a程序实例_世界最小的Arduino——ATTiny13上手全攻略1B在Arduino IDE环境下的搭建...

    本帖最后由 幻生幻灭 于 2017-2-15 10:41 编辑 系列教程传送门 世界最小的Arduino--ATTiny13上手全攻略1A简介 世界最小的Arduino--ATTiny13上手全攻略1 ...

  5. 写给屌丝程序员的免费空间个人blog的建站攻略

    我相信每个攻城师bloger都有一个自己拥有独立空间的梦想.找主机托管一年至少也得几百RMB吧,魔都这生活成本挣点钱还得不够养家糊口的,于是大家退而求其次在博客园落了脚.博客园作为屌丝程序员集散地,稳 ...

  6. 菜鸟程序员的成长之路:Python四大进阶攻略

    随着人工智能的发展与应用,Python编程语言受到世界各界人士的关注,编程圈金句从"人生苦短,我学Python"转变成了"学完 Python,可以上天",Pyt ...

  7. win10启动修复_win10下以安全模式启动电脑全攻略,装机、修复电脑故障必备

    在Windows 10上,安全模式允许加载一组基本功能和通用设备驱动程序,足以解决常见的软件和硬件问题. 例如,当计算机无法正常启动.网络连接问题以及应用程序或Windows Update无法下载更新 ...

  8. 驱动程序和应用程序之间的体系结构不匹配_修复Win10上的黑屏问题全攻略,并不高深,一看就会...

    在Windows 10上,你可能会遇到的最烦人的问题之一是黑屏,因为你不会在屏幕上看到错误代码或消息以获取有关从何处开始进行疑难解答的提示. 黑屏的发生可能有多种原因.它可能与最近的显卡驱动程序更新有 ...

  9. win10下的python3.5+ opencv安装攻略

    准备文件: python 3.5 ,pip10 ,Notepad++ 1.先下载python3.5 安装 参考:廖雪峰的教程 https://www.liaoxuefeng.com/wiki/0014 ...

  10. Linux下Makefile的automake生成全攻略--转

    http://www.yesky.com/120/1865620.shtml 作为Linux下的程序开发人员,大家一定都遇到过Makefile,用make命令来编译自己写的程序确实是很方便.一般情况下 ...

最新文章

  1. centos7 安装 Mysql 5.7.28,详细完整教程
  2. String创建方式及其区别(快速了解)
  3. 机器学习笔记7-监督学习
  4. 收藏:通信网络基础知识
  5. 【Matlab】矩阵三角分解法求解方程组
  6. 工作原理是什么_磁翻板液位计工作原理是什么?
  7. 【渝粤教育】电大中专新媒体营销实务 (13)作业 题库
  8. 线程的互斥与同步机制
  9. SpringCloud微服务:Sentinel哨兵组件,管理服务限流和降级
  10. 新建的ORACLE实例要开启监听,创建ORACLE实例与设置监听器过程
  11. 不支持给定路径的格式_剑指offer_12_矩阵中的路径
  12. alreader 2 android,【AlReader2怎么用】AlReader2好不好_使用技巧-ZOL软件百科
  13. echarts3与echarts2区别
  14. 老王python培训视频教程完整版
  15. 华为HPLC模组全拆解之电力载波收发原理分析
  16. 计算机的ps快捷键,ps快捷键常用表
  17. 电台、手台用语黑话集锦
  18. [三剑客]老男孩教育-三剑客笔试题集合
  19. KendoUI学习笔记
  20. Mybatis数据库表字段有关键字

热门文章

  1. 马来酰亚胺偶联二硒化钨 (WSe2-MAL)|N-羟基琥珀酰亚胺偶联WSe2二硒化钨纳米颗粒 (WSe2-NHS)
  2. 基于PLC控制的导热油温控系统如何实现远程监控
  3. Acrobat could not access the recognition service, Acrobat无法使用识别服务
  4. FRDM-KW36入门学习(二、运行heart_rate_sensor工程)
  5. tornado协程(coroutine)
  6. c 打印html文档,C# C/S程序使用HTML文件作为打印模板
  7. 机器学习:详细推导EM算法
  8. ChiMerge 算法: 以鸢尾花数据集为例
  9. IPTV 和OTT TV 理解比较和应用
  10. 什么是绿色计算?为什么绿色计算十分重要?