I fiddled with this for a couple of hours and couldn't find a solution...
Lets say I print this to a terminal (tested with bash and zsh in a genome-terminal in a VM running a fresh Linux Mint):
python3
print("\033[41mFOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO\033[0m BAR")
\033[41m
enables a red background for the text that follows.\033[0m
resets the background to the default.- Assume that there are enough O's to generate an output which fills exactly one and a half lines in the terminal.
In a fresh terminal the output looks like this (like I expected):
|FOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO|
|=================================|
|OOOOOOOOOOOOOO BAR |
|============== |
| |
- Every char that is underlined with a
=
has a red background. |
Defines the border of the terminal.
So we see FOO...
with a red background and BAR
without a red background.
If I run the command again I get this:
|FOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO|
|=================================|
|OOOOOOOOOOOOOO BAR |
|============== ===============|
| |
After BAR
the line continues to be red... and I have no clue why? Any idea?