Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法让每个窗口自动将其名称更改为您从该窗口运行的最后一个程序的名称?
这比手动重命名窗口更方便。
是的,您可以使用 shelltitle 来执行此操作。
假设您使用 bash,以下应该可以工作。将此添加到您的.screenrc:
.screenrc
shelltitle "$ |bash"
其中“$”应该与提示字符串($PS1)末尾的任何内容匹配,并且“bash”是默认标题。然后在提示字符串的开头添加一个空标题转义序列:
export PS1='\[\033k\033\\\]'$PS1
应该放在你的.profile或其他的。
.profile