It's possible to change the xterm font size by holding ctrl and right-clicking the window. Is it possible to do it without a mouse?
2 Answers
The default keybindings include what's needed:
Shift~Ctrl <KeyPress> KP_Add:larger-vt-font() \n\ Shift Ctrl <KeyPress> KP_Add:smaller-vt-font() \n\ Shift <KeyPress> KP_Subtract:smaller-vt-font() \n\ That is (without any customization needed):
- shift
keypad +switches to the next-larger font. - shift
keypad -switches to the next-smaller font.
There are two bindings for KP_Add to make it workable by default on some unusual keyboards.
This was originally just for bitmap-fonts (in 1999); TrueType fonts were accommodated in 2008.
It is also possible to do this with an escape-sequence, e.g.,
printf '\033]50;#+1\007' to switch to the next-larger font, and
printf '\033]50;#-1\007' to switch to the next-smaller font. The fonts.sh script in the sources makes xterm repeatedly shrink/grow, and when interrupted, restores the original font. (The \007 in the printf is a nonprinting control/G in the script to accommodate very old shells).
- Thank you. Would you explain how to do it with an escape sequence as well? I couldn't tell from the linked page.Toothrot– Toothrot2020-03-21 18:39:30 +00:00Commented Mar 21, 2020 at 18:39
XTerm.vt100.translations: #override \n\.