LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   get terminal color? (https://www.linuxquestions.org/questions/programming-9/get-terminal-color-73327/)

cratos 07-16-2003 03:04 PM

get terminal color?
 
When writing bash scripts I know you can change the color and background color so that you can make pretty pictures 'n things but when I go to change it back I use 'tput sgr0' and it changes the colors back to the origninal colors for the console, which is usually fine but if the user has change his colors after starting up, the script sets the wrong colors.
Is there a way to get the current background and foreground colors that are being used? You can save and restore cursor position so why cant you save and restore current colors?

Thank you


All times are GMT -5. The time now is 02:55 AM.