gnu screen:您可以在上次调用的程序之后自动为窗口命名吗? [英] gnu screen: can you automatically name a window after the last invoked program?

查看:68
本文介绍了gnu screen:您可以在上次调用的程序之后自动为窗口命名吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一种方法可以让每个窗口自动将其名称更改为您从该窗口运行的上一个程序的名称?

Is there a way to automatically have each window change its name to the name of the last program you ran from that window?

与手动重命名窗口相比,这会更方便.

This would be more convenient than having to rename the windows manually.

推荐答案

是的,您可以使用shelltitle来做到这一点.

Yes, you can use shelltitle to do this.

假设您使用bash,则应该可以进行以下操作.将此添加到您的.screenrc:

Assuming you use bash, the following should work. Add this to your .screenrc:

shelltitle "$ |bash"

其中"$"应与提示字符串($ PS1)末尾的任何内容匹配,而"bash"是默认标题.然后将空标题转义序列添加到提示字符串的开头:

where the "$ " should match whatever is at the end of your prompt string ($PS1) and "bash" is the default title. Then add a null title escape sequence to the beginning of your prompt string:

export PS1='\[\033k\033\\\]'$PS1

应该放在您的.profile或其他任何内容中.

which should go in your .profile or whatever.

这篇关于gnu screen:您可以在上次调用的程序之后自动为窗口命名吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆