windows terminal 适配远程server的zsh

记录一下怎么配置的

server端配置

在server上安装zsh(需要reboot)和oh-my–zsh,然后在./zshrc中设置ZSH_THEME="agnoster"

# 安装zsh-syntax-highlighting语法高亮插件
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git
echo "source ${(q-)PWD}/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> ${ZDOTDIR:-$HOME}/.zshrc
source ~/.zshrc

client端配置

拉取字体git clone https://github.com/powerline/fonts.git --depth=1,如果是unix直接执行install.sh即可,如果是windows terminal(以下简称WT):

  1. 管理员身份运行WT
  2. 执行set-executionpolicy remotesigned开启运行脚本权限
  3. 执行install.ps1,将powerline字体安装到系统
  4. 打开 用户设置-字体,从*****for powerline名称的字体挑个,复制不了名称可以在README里面找
  5. ctrl + ,在WT中打开设置
  6. 修改json文件,添加fontFacefontSize
{
    .....
    "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",
                "startingDirectory": ".",
                "hidden": false,
                
				"fontFace": "Roboto Mono for Powerline",
				"fontSize": 11
            },
			......
        ]
    },
    .......
}

效果和ubuntu终端下的效果还是有差距的,少了很多色彩
在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值