A status bar at bottom of terminal in place of PS1

This proposal should be read as a "proof of concept", not necessarily a turnkey solution. May need to be refined / adapted.

You seem to use console_codes anyhow in your PS1 so some extended usage might be allowed. For a "status bar" to appear at the bottom of the screen no matter how that was resized before, the LINES shell variable can be used, as well as some shell integer arithmetics, to shrink the scrolling region, save / restore the cursor location, and print to the bottom of the screen. Try

CSI=$'\e'"["
PS1="\[${CSI}s${CSI}1;$((LINES-1))r${CSI}$LINES;1f\u:YourOutputGoesHere:\w${CSI}K${CSI}u\]>"

There are known caveats when dealing with the PS1 shell variable and function codes which haven't necessarily been considered here but covered in e.g. other threads, search in these fora and incorporate if need be.

Tags:

Bash

Prompt

Tmux