Gnu screen: can you automatically name the window after the last running program?

Is there a way to automatically change each window to its name in the name of the last program that you started from this window?

This would be more convenient than manually renaming windows.

+5
source share
1 answer

Yes, you can use shelltitle for this.

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

shelltitle "$ |bash"

where "$" should match what is at the end of the query string ($ PS1), and "bash" is the default header. Then add a null-header escape sequence at the beginning of the prompt line:

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

.profile - .

+5

All Articles