从 bash 脚本更改 xterm 的标题
我有一个可以进行长时间构建的脚本。该脚本需要几个小时才能完成,并且在构建过程中我无法知道脚本已经运行了多少。 为此,我考虑更改脚本中 xterm 的名称以反映下标。
那么,问题是如何更改 script 中的 xterm 标题?
我尝试添加以下行: echo -e '\033k'$mytitle'\033\' 这是我从其他帖子中获得的,但它不起作用。
感谢您的帮助!
I have a script which does a long build. It takes like hours for this script to complete, and while the build is going on there is no way for me to know how much the script has run.
For that I thought of changing the name of the xterm from the script to reflect the subscript.
So, the question is how do I change the xterm title from script ?
I tried adding lines like: echo -e '\033k'$mytitle'\033\' which I got from some other post, but it doesnt work.
Thanks for the help !
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
有一个名为 xtermcontrol 的程序,它可以让您完全控制 xterm 之类的东西。
如果您无法设置标题,则可能它已被锁定:
您通常可以拉出“字体”菜单(右控)并选中或取消选中“允许标题操作”按钮以在运行时进行配置。选中允许您更改标题。
这个程序也适合我:
仔细打字!
There is a program called xtermcontrol which lets you have full control over xterm stuff like that.
If you cannot set the title, perhaps it is locked:
You can normally pull up the Font menu (control-right) and check or uncheck the "Allow Title Ops" button to configure this at runtime. Checked allows you to change the title.
Also this program works for me:
Type carefully!
设置 xterm 标题的正确转义似乎是
\033]0;
和\007
,请参阅 http://tldp.org/HOWTO/Xterm-Title-4.html 了解提示,以及 http://www.faqs.org/docs/Linux- mini/Xterm-Title.html#ss3.1 用于转义序列定义。The correct escape for setting xterm title seem to be
\033]0;
and\007
, see http://tldp.org/HOWTO/Xterm-Title-4.html for tips, and http://www.faqs.org/docs/Linux-mini/Xterm-Title.html#ss3.1 for the escape sequence definition.看看这篇文章
Set screen-title from shellscript
根据您的帖子缺少
\
,它应该是Take a loo at this post
Set screen-title from shellscript
As per the post you are missing a
\
and it should be