禁止 Windows terminal 中的光标闪烁

1,322 阅读1分钟

Windows terminal 还没有原生支持禁用光标闪烁的功能,这里是在 github 上找到的一个方案分享一下。

打开所用的 shell 的配置文件,比如这里以 powershell 为例:

# 使用记事本打开 powershell 的配置文件
notepad $profile

然后在配置文件中根据需要写入以下内容:

# powershell
Write-Host -NoNewLine "`e[2 q"

# cmd
@echo <esc>[2 q

# bash
echo -e -n "\e[2 q"

最后重启生效。

参考链接