如何在gnome-terminal中禁用闪烁的光标?

我本可以发誓,在gnome-terminal“Profile”中曾经有过这样的设置。

然后在某些版本的Ubuntu中,该设置消失了,我不得不使用系统➜首选项➜键盘取消选中“光标在文本字段中闪烁”。

嗯,这些似乎都没有。 那么如何让光标停止闪烁?

是的,gconf中隐藏了一个设置。
打开gconf-editor,导航到/apps/gnome-terminal/profiles/Default ,找到cursor_blink_mode并将其值更改为off

您也可以从命令行禁用闪烁(默认情况下不安装gconf-editor):

  gconftool-2 --set /apps/gnome-terminal/profiles/Default/cursor_blink_mode --type string off 

对于较新版本的gnome-terminal,命令已更改:

 gsettings set org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:$(gsettings get org.gnome.Terminal.ProfilesList default|tr -d \')/ cursor-blink-mode off 

我几乎在每一个Gnome安装上都会回顾这篇文章。 似乎实际变量名称经常变化。

我的解决方案: gsettings list-recursively | grep blink gsettings list-recursively | grep blink

然后我将链接值从True设置为False。 截至目前,它是org.gnome.desktop.interface cursor-blink,所以:

gsettings set org.gnome.desktop.interface cursor-blink false

希望这对未来的其他人有所帮助!

您可以使用tput将转义序列发送到终端(我认为任何POSIX兼容)设置当前游标字符:

 tput civis # invisible tput cnorm # normal (usually an underscore) tput cvvis # very visible (usually a rectangle) 

只需在你的本地runco​​m脚本中添加你喜欢的任何内容: ~/.zshrc~/.bashrc – 无论你的毒药是什么 – 或者如果你希望它为所有用户运行,可以在/etc中的全局。