7

基于 Fluent Terminal 和 WSL 的 Windows 命令行工具

 3 years ago
source link: https://wushuo.ink/post/fluentterminalwsl/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

基于 Fluent Terminal 和 WSL 的 Windows 命令行工具

· 2020-08-27 · # 技术 # Linux

嘿,我打赌你一定会喜欢这些优雅的东西!

适用于 Linux 的 Windows 子系统(英语:Windows Subsystem for Linux,简称WSL)是一个为在Windows 10和Windows Server 2019上能够原生运行Linux二进制可执行文件(ELF格式)的兼容层。----维基百科

# 效果图演示

1610031931735.webp

# 安装 Windows Fluent Terminal 来取代古老的 CMD

  • Microsoft SoreGithub开源社区下载 Windows Fluent Terminal 。
  • 赶紧开启 亚克力/ Acrylic背景或者添加您喜爱的图片设为背景

# Windows 和 Linux 是天生一对

Microsoft love Linux
--Microsoft CEO Satya Nadella

在 Windows 安装适用于Linux 的 Windows 子系统,不仅可以保留 Windows 个人电脑的便捷,同时享受到 Linux 更加便捷的开发环境和开放的软件环境。

坐稳了,我们要正式开始安装WSL

  • 在微软商店里下载 Ubuntu 18.4 LTS系统或是其他你喜欢的 Linux 子系统
  • 它会出现在我们的开始菜单栏中,但这并不是我们所需要的
  • 朋友,这时候微软的自家软件就得开始团结协作了,打开 Windows Fluent Terminal 的菜单,你就能看到 Ubuntu 18.4 LTS 的身影了

# 谁说 Linux 不能姹紫嫣红

现在你也许会想,为什么我的 Linux 没有五颜六色的代码,也许更专业地说是代码高亮。

oh-my-zsh 给命令行锦上添花

  • 跟随 Github 开源项目指南,让您的 Linux 配备oh-my-zsh
  1. 使用 Git 从Github 上克隆到本地 或者 通过Github Desktop 手动下载
    git clone https://github.com/ohmyzsh/ohmyzsh.git ~/.oh-my-zsh 
    
  2. 使用 Windows Fluent Terminal 试试 cp 命令的复制上传功能吧
    # wushuo @ DESKTOP-91UDQ1D in /mnt/c/Users/Shuo [19:24:45]
    $ cd Desktop
    
    # wushuo @ DESKTOP-91UDQ1D in /mnt/c/Users/Shuo/Desktop [19:25:21]
    $ cp ohmyzsh-master.zip /home/wushuo
    
    # wushuo @ DESKTOP-91UDQ1D in /mnt/c/Users/Shuo/Desktop [19:27:21]
    $ cd /home/wushuo
    
    # wushuo @ DESKTOP-91UDQ1D in ~ [19:27:36]
    $ ls
    ohmyzsh-master.zip
    
  3. 解压文件并运行 oh-my-zsh.sh
    # wushuo @ DESKTOP-91UDQ1D in ~ [19:27:50]
    $ gzip ohmyzsh-master.zip
    
    # wushuo @ DESKTOP-91UDQ1D in ohmyzsh-master [19:27:51]
    $ sudo ./ohmyzsh.sh
    
  4. 现在将zsh设为默认shell即可
    chsh -s $(which zsh)
    

# 这是 oh my zsh,独一无二的zsh

  • 现在为 oh-my-zsh 设定你喜爱的主题
    vim ~/.zshrc
    
  • 更改你喜爱的主题通过如 ZHS_THEME="ys"
    ZSH_THEME="agnoster" # (this is one of the fancy ones)
    # see https://github.com/ohmyzsh/ohmyzsh/wiki/Themes#agnoster
    

不仅如此,你也可以通过 Windows Fluent Terminal 更改配色

  • 默认的设置一直都不错,除非你更偏爱白色的清晰,那样 Tomorrow 也许才是你的菜
wsl1

# 你知道吗,Git 和 WSL 协作无可匹敌

  • 还在忍受 Windows 上不优雅的 git 工具吗,现在投奔 WSLLinux 原生 git 的怀抱
  • 通过 WSL 对 Windows 的映射,您可以轻松使用 WSL 访问主机的资源,git 也毫不例外
    ### 通过 git 将图形学项目 Taichi 克隆到本地
    # wushuo @ DESKTOP-91UDQ1D in /mnt/c/Users/Shuo/Desktop [19:57:39]
    $ git clone https://github.com/taichi-dev/taichi
    

感谢您的认真观看,我衷心地希望这对您有些许帮助

转载请注明作者及出处


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK