English 中文(简体)
gnu screen: can you automatically name a window after the last invoked program?
原标题:

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.

最佳回答

Yes, you can use shelltitle to do this.

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

shelltitle "$ |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= [33k33\] $PS1

which should go in your .profile or whatever.

问题回答

暂无回答




相关问题
switching between screens

I m using GNU screen just recently. I m wondering if there is an easier way to switch between screen. for example to map it to alt+left arrow and alt+right arrow ?

Custom script in .screenrc

I made a script that spawns a remote shell or runs a local shell whether it s on the current machine or not: #!/bin/bash # By: benoror <benoror@gmail.com> # # spawns a remote shell or runs a ...

GNU Screen: Changing Global Key-binding

I ve recently started using screen in remote sessions. One problem is that emacs doesn t recognize its C-a and I don t want to bind emacs C-a to something else, as I m very used to it. Google shows ...

Set screen-title from shellscript

Is it possible to set the Screen Title using a shell script? I thought about something like sending the key commands ctrl+A shift-A Name enter I searched for about an hour on how to emulate ...

热门标签