Is there a way to apply (for example the font(size)) changes to .Xdefaults to all running terminals in a session?

I can apply it to new terminals via loading xrdb -load .Xdefaults, but this doesn't apply to all running terminals.

If it matters I am using urxvt (in daemon mode) as terminal and xmonad as window manager on ubuntu 15.10.

Just for the font sizes I had the idea that one could use the fontsize perl-extension to inject a fontsize change to each open terminal, but I don't know how to do this.

  • I don't believe so because each terminal is a separate instance and totally independent of every other. However, I am not particularly familiar with urxvt. I just know that the original hardware terminals were never intended for anything like that, so I doubt highly that that functionality exists. – Wyatt8740 Feb 9 '16 at 16:55

A quick read of urxvt(1) and then from the synopsis of the mentioned urxvt(7) reveals that rxvt-unicode terminals support escape sequences that can alter e.g. the font:

          # set a new font set
          printf '\33]50;%s\007' 9x15,xft:Kochi" Mincho"

These would have to be printed into each open terminal, and some translation would likely be required to convert the .Xdefaults format into something suitable for such printing.


Reloading the configuration is a feature that not all programs support. X resources in particular are usually read when a program starts up; there's no protocol to notify an application that it should use new resources¹. Rxvt tends towards being small, so it's no surprise that it doesn't support reloading its configuration after startup.

Some settings can be changed dynamically. In particular, the font can be changed via control sequences. You can emit these control sequences from anywhere, just redirect the output to the right terminal device:

printf '\33]50;%s\007' … >/dev/pts/42

I can't think of a way to list the terminal devices that rxvt is providing. You can easily list the devices where you have processes running, this may be good enough.

for pts in $(ps x -o tty= | sort -u); do
  case "$pts" in pts/*) printf … >"/dev/$pts";; esac

¹ Actually, there is one — editres — but who's heard of editres? Nobody, that's who.

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.