How to determine the current color of the console output?
20
votes
3
answers
14527
views
I know that, if a coloured terminal is available, one can colour the output of it using escape characters .
But is there a possibility to find out, which colour the output is currently being displayed as? Or better, what colour the text would be, if I would output it right now?
I'm asking to not break any previous colour settings, when using these escape characters. The 'default foreground colour' escape character is getting it's information from the colour scheme, rather than the text colour before I changed it.
Asked by Minix
(6065 rep)
Dec 10, 2014, 02:04 PM
Last activity: Feb 3, 2025, 05:13 AM
Last activity: Feb 3, 2025, 05:13 AM