Hi all,
lately I encountered a “problem” which I couldn´t really solve.
Well, it´s not a real problem, rather a phenomenon I´d like to know the solution to.
This is the scenario:
I open a terminal (Linux Lite or Archlinux, it doesn´t matter). It may be xfce4-terminal
, lxterminal
, or xterm
.
They all behave the same.
The colour settings I use for e.g. xfce4-terminal
are aubergine for the background and white for the characters.
I wanted to change the settings, but not on a permanent basis, so the settings options of the terminal emulator wouldn´t be the right way of doing it for me.
So I tried this:
printf '\033]11;#FFFFFF\007' # Set terminal background colour to white
printf '\033]10;#000000\007' # Set terminal foreground colour to black
This worked well.
And it´s for the current tab only. If I open a new tab in the terminal it´s back to the defaults.
This is the way I like it.
As I said, the commands from above worked well, but I might want to use them within a script and after running a command within the script I want to get back to the defaults.
So the question is: what commands are needed to get back to them
I tried:
printf '\033]11;#XXXXXX\007' # Set terminal background colour back
printf '\033]10;#YYYYYY\007' # Set terminal foreground colour back
but it didn´t work. The terminal stayed black on white.
Do you have any ideas why that is?
I even tried:
tput init # Reset terminal colors using tput
This didn´t change it either.
Thanks a lot for yor help.
Many greetings from Rosika