2

Is there a way to change the background color an an xterm window without clearing the screen? I want to have a prompt that changes the entire screen's color, but I don't want to clear the screen

4

For instance like this: echo -e '\e]11;rgb:cc/ff/cc\a' (yields a light green background).

For more possibilities, check the xterm control sequences documentation.

7
  • Do you mean \033 for \e?
    – vy32
    May 8 '13 at 22:12
  • yes. \e is escape (^[, \033), \a is bell (^G, \007)
    – Uwe
    May 8 '13 at 22:41
  • So why do you want a bell?
    – vy32
    May 9 '13 at 0:36
  • According to the document I cited, the control sequence is <escape>]11; + color name + <bell>.
    – Uwe
    May 9 '13 at 6:25
  • Ah, okay. Thanks. Unfortunately that sequence doesn't work on my Apple Terminal client, which is supposed to implement xterm sequences but I guess doesn't.
    – vy32
    May 9 '13 at 12:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.