在 Ubuntu 中设置 Terminator(控制台应用程序)中选项卡的标题
有没有办法通过 bash 命令行 (CLI) 将选项卡的终止符(版本:0.95ppa1)标题设置为不同的字符串?
我计划将此功能与 AutoKey 一起使用,我可以同时打开多台计算机并将标题设置为其连接的计算机的名称。
Is there way to set terminator (Version: 0.95ppa1) title of tabs to a different string via bash command-line (CLI)?
I plan to use this feature with AutoKey and I can open multiple machines at same time and set title to Name of the machine its connected to.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(10)
将标题重置为
这应该适用于所有 xterm 风格的终端模拟器。
Resets title to
This should apply to all xterm-style terminal emulators.
从终结者手册页中,
您还可以使用以下命令启动新实例
From the Terminator man pages,
You can also launch a new instance with
使用
vim ~/.bashrc
编辑它,在.bashrc
文件中添加以下内容,并使用set_title
重命名您的选项卡:运行
source编辑
命令.bashrc
文件后的 ~/.bashrc例如:
set_title newtab
会将当前选项卡重命名为newtab
正常工作在Gnome3.14中终端和终止符0.97
Add follwing in your
.bashrc
file by editing it usingvim ~/.bashrc
and useset_title
to rename your tab:run
source ~/.bashrc
command after editing your.bashrc
fileEx.:
set_title newtab
will rename your current tab tonewtab
working Properly in Gnome3.14 terminal and terminator 0.97
在Terminator 1.91-6上双击终端标题启用版本
On Terminator 1.91-6 double click terminal title enables edition
PS1不需要设置。这个函数归功于 freenode 上的 geirha #bash
set_title() { printf '\e]2;%s\a' "$*"; }
PS1 does not need to be set. Credit for this function goes to geirha on freenode #bash
set_title() { printf '\e]2;%s\a' "$*"; }
这似乎对我有用。我在 Crunchbang 上使用 BASH(源自 Debian)
This seems to work for me. I'm using BASH on Crunchbang (Debian derived)
对于 Terminator 0.96 和 GNU bash 4.2.25,上面的
printf
建议对我有用,但我必须稍微调整它,使其成为一个只在新的 Terminator 选项卡中为我工作的函数。我将其添加到我的~/.bashrc
文件的末尾:是将
\a
放在引用字符串的末尾。然后,当在终结者中打开新选项卡时,我可以像这样使用它:向那些已经陈述了这个答案的要点的人表示歉意,但由于我发现我必须进行一些细微的更改才能使其为我工作,这也使其他人受益。
With Terminator 0.96 and GNU bash 4.2.25 the
printf
suggestion above worked for me, but I had to tweak it slightly to make it into a function that would just work for me in a new Terminator tab. I added this to the end of my~/.bashrc
file:The key was placing the
\a
at the end of the quoted string. Then when opening a new tab in Terminator I can use this like so:Apologies to those who already stated the essentials of this answer, but since I found that I had to make slight changes to get it to work for me, this my also benefit someone else.
尝试在 .bashrc 中添加
PROMPT_COMMAND='echo -en "\033]0; $("pwd") \a"'
Try add
PROMPT_COMMAND='echo -en "\033]0; $("pwd") \a"'
in your .bashrc对于终结者 0.98 (Ubuntu 16.04 MATE),右键单击标题可以对其进行重命名。
For terminator 0.98 (Ubuntu 16.04 MATE), right clicking the title enables renaming it.
右键单击终结符并从下拉菜单中选择首选项。选择配置文件选项卡并启用“显示标题栏”选项。有用!!
提示:您实际上可以重命名每个终结者窗口!
Right click on terminator and choose preferences from the drop-down menu. Choose profiles tab and enable "show title bar" option. It works!!
Tip: You can actually rename each terminator window!!