How do I change the default colors of a running Xterm?

3k Views Asked by At

When you start an xterm, its default colors are determined by .Xdefaults OR --fg and --bg options. Those are the defaults for this particular xterm process. If you then change colors with ansi sequences, when you send the ansi reset sequence, you get back to the colors it started up with.

What I want to change is the defaults for this particular xterm process. I want to, in effect, re-exec the xterm command with a new set of --fg and --bg options.

Is there an option to reset the default colors, not the current colors?

1

There are 1 best solutions below

1
Thomas Dickey On

The dynamic colors feature does that (does not get "reset" in the normal escape sequences, which use "ANSI" escapes):

The 10 colors (below) which may be set or queried using 1 0 through 1 9 are denoted dynamic colors, since the corresponding control sequences were the first means for setting xterm's colors dynamically, i.e., after it was started. They are not the same as the ANSI colors (however, the dynamic text foreground and background colors are used when ANSI colors are reset using SGR 3 9 and 4 9 , respectively).