4

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

2 Answers 2

9

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):

  • shiftkeypad + switches to the next-larger font.
  • shiftkeypad - 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).

1
  • Thank you. Would you explain how to do it with an escape sequence as well? I couldn't tell from the linked page. Commented Mar 21, 2020 at 18:39
3

try

xterm -fa 'Monospace' -fs 14 

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.