V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
rdh45
V2EX  ›  Z shell

在 shell (zsh) 中键入命令时会重复第一个字符的 bug

  •  
  •   rdh45 · May 30, 2024 · 1371 views
  •   You need to sign in to view this topic
    This topic created in 706 days ago, the information mentioned may be changed or developed.
    分享一个最近解决的 shell (zsh) 上的小 bug
    更新 iTerm3.5 后发现输入某些命令时第一个字符会重复显示,而且无法删除。( brew 的 b 删不掉啊什么的)
    排错后发现是 zsh-autosuggestions 和命令提示符的兼容性导致的。

    在这里看到解决方法:
    https://unix.stackexchange.com/questions/90772/first-characters-of-the-command-repeated-in-the-display-when-completing?newreg=86b46ada169242b98dd693f95898d64b

    简单来说就是用类似`%12{…%}`的方式把所有没包进去的提示符包进去,手动提示提示符的宽度为 12 位(你得自己数)
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3319 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 14:18 · PVG 22:18 · LAX 07:18 · JFK 10:18
    ♥ Do have faith in what you're doing.