V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
linzhe141
V2EX  ?  Visual Studio Code

vscode 中的 zsh 多了个 "\",有人知道怎么取消这个吗?

  •  
  •   linzhe141 · 22 天前 · 623 次点击

    腾讯云最新优惠活动来了:云产品限时1折,云服务器低至88元/年 ,点击这里立即抢购:9i0i.cn/qcloud,更有2860元代金券免费领取,付款直接抵现金用,点击这里立即领取:9i0i.cn/qcloudquan

    (福利推荐:你还在原价购买阿里云服务器?现在阿里云0.8折限时抢购活动来啦!4核8G企业云服务器仅2998元/3年,立即抢购>>>:9i0i.cn/aliyun

    img

    多了个 \ 导致 zsh-autosuggestions 的提示会错位,就贼难用

    我输入的是npx eslint ./index.js,但是显示的是 npxx eslint ./index.j s

    img

    现在我只能每次执行完命令后,手动再输入一次zsh才行

    这个只会再 vscode 的终端才会出现,其他终端都是正常的

    2 条回复  ?  2024-04-11 16:34:38 +08:00
    jswxg
        1
    jswxg  
       22 天前
    这是 zsh 自动转义功能,要关闭可以在 ~/.oh-my-zsh/lib/misc.zsh 里把下面对应的代码注释掉即可。

    if [[ $ZSH_VERSION != 5.1.1 ]]; then
    for d in $fpath; do
    if [[ -e "$d/url-quote-magic" ]]; then
    if is-at-least 5.1; then
    autoload -Uz bracketed-paste-magic
    zle -N bracketed-paste bracketed-paste-magic
    fi
    autoload -Uz url-quote-magic
    zle -N self-insert url-quote-magic
    break
    fi
    done
    fi
    linzhe141
        2
    linzhe141  
    OP
       22 天前
    我这个应该是 vscode 的 bug ,我拖动终端的宽度,就正常了
    @jswxg
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1011 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 18:20 · PVG 02:20 · LAX 11:20 · JFK 14:20
    Developed with CodeLauncher
    ? Do have faith in what you're doing.


    http://www.vxiaotou.com