Is there a way to dynamically update the window name on the Gnu screen?

I want Gnu Screen to dynamically rename the current screen window after the current directory. Is there any way to get a screen for this? If this requires fixing the source, I would like to know that this is the only option.

+4
source share
2 answers

It's really possible, see Automagic Screen Headers and Dynamic Headers from the screen guide.

+5
source

This function will give you a title command call, which you can then use to change the name of the screen window.

 title() { printf $'\ek%s\e\\' "$1"; } 

If you use a decent shell (e.g. zsh ), you have precmd and prexec hooks from which you can run any command before and after the prompt. I suggest you use them to update the window title.

Corrected above from the information found at: GNU Screen: Cover Examples

(Sorry, the short answer is, I'm in a hurry and can expand on later.)

0
source

Source: https://habr.com/ru/post/1333335/


All Articles