Just to give a quick example:
~$ cd ~/Documents/
~$ ls
a file another file
~$ echo “Ok”
Ok
~$ rm *
~$ ls
~$ cd
This is inspired by this question, where trap 'echo' DEBUG
is used to add an empty line before and after the output of every command. Unfortunately, empty lines are still added if the command had no output. Another downside of trap 'echo' DEBUG
is that it is a bit ‘hacky’ and I’ve heard of it breaking some programs. It also adds empty lines between the output of commands in a pipe.
Now, I realise that it may not be possible to add an empty line before the output of a command because, to check if the command has any output, the output has to first be printed to the screen, and then you can’t add the empty line! Because of this it would also be OK if there’s an empty line between each prompt when running a command without output, just not that there’s two lines, like with trap 'echo' DEBUG
.
The reason I’m doing this is I often find it difficult to find my prompt in a sea of output, especially when it is a colourful diff. I have tried two-line prompts, sometimes with empty lines before, and also adding a hideous mess of colours to my prompt. Neither has been quite satisfactory.
Thanks for the help!