I'm very surprised to find your question, because I developed pretty much exactly this over a week ago.
Check out Basta (Bash Status Line).
This is Bash code with few external dependencies (it requires stty
, sleep
and kill
) which you can source in your .bashrc
.
You get a scroll-protected, persistent status line at the bottom of the terminal, in which the time, host name and current directory are displayed.
If you look at the history, you can see I debugged this for a number of issues.
The clock is shown in inverse video, and updates spontaneously even if Bash is just sitting at a prompt, waiting for input.
This tiny project was motivated by having too cluttered a prompt for too many years. I wanted to have a $
prompt, but still see the current working directory and other things: and not in the window title, where my eyes rarely go.
I also use PuTTY and screen; it works inside screen and outside. I've tested with Termux, PuTTY and Gnome Terminal so far.
If you want to disable it while inside screen, you can probably make it conditional whether you source Basta or not based on the TERM
variable, which contains something like screen-256color
.