Put the following into a file:
if [ "$BASH_COMMAND" != command2 ]
trap command1 debug
if [ "$command_flag" ]
I advise you to change the names
to values that you’re not likely to type. Then
source that file.
(Or just put the above into your
trap command1 debug command causes the
command1 function to be called
any time you type a command. The
command_flag flag to indicate that there was a command.
command1 function is not called when you just hit Enter.)
PROMPT_COMMAND=command2 causes the
command2 function to be called
whenever the shell is about to issue a
command2 function checks the
to see whether you typed a command or just Enter.
If you typed a command,
command_flag will be set
command2 will write a blank line to the screen.
(If you figure out how to create a vertical space that’s a fraction of a line,
If you just hit Enter,
command_flag will not be set.
Then clear the flag so the next prompt will be done correctly.
Note that the
command1 function is called
when the shell runs the
command1 needs to make it a special case
(it doesn’t count as a command).
\E#6- double/single-height/width line top/bottom modes. And they're not alone.