------------------------------------------------------------------------------- XTERM general hints and tips ------------------------------------------------------------------------------- To get the size of the screen use tput echo "lines: $(/usr/bin/tput lines)" echo "columns: $(/usr/bin/tput cols)" ------------------------------------------------------------------------------- PageUp and PageDown in Xterm Applications >How do i use the PAGEUP and PAGEDOWN keys in Xterm. >When i press these keys only the Xterm window scrolls but i want to use >these keystrokes in my remote application. Put this in your .Xdefaults[-]: XTerm*VT100*Translations: #override \ Prior: string(\002)\n\ Next: string(\006)\n\ Home: string(\001)\n\ End: string(\005)\n ------------------------------------------------------------------------------- If the Xterm has been compiled to use the freetype font library you can use a font seletion like (as used in Gnome) xterm -fa MiscFixed -fs 12 ------------------------------------------------------------------------------- One font only... Bold Overstrike Xterm is then forced to use offset-overstike and color bolding instead FONT="-misc-fixed-medium-r-*-*-15-*-75-75-c-90-iso10646-1" xterm -fn "$FONT" -fb "$FONT" This came about as the bold version of the above font does NOT contain many unicode glyphs (like braile) displaying dashed boxes instead. By using the same font for both, overstiking is used for bold, including those unicode characters. ------------------------------------------------------------------------------- ANSI Escaped Capitals... Vim-8.2 In some situations XTerms can enable 'ModifyOtherKeys' mode where capital letter keystokes output ANSI escape sequences rather that the capital letter. For example typing 'A' results in '\e[27;2;65~' (10 character input) Where the '2' means shifted and '65' is the character code for capital-A. VIM for example is using this mode to allow it to differentiate between various shift/control/meta keys, and in some specific cases this mode is 'leaked' to a keyboard reader. EG: password reading filter in a VIM 'autocmd'. In the document "XTerm Control Sequences" https://invisible-island.net/xterm/ctlseqs/ctlseqs.pdf See "Set/reset key modifier options", and later "Unset", on page 19, and the results of this in "Alt and Meta Keys" on page 31. A solution is to ensure XTerms disables this before reading input. It was also reports and is hopefully fixed on newer XTerms. if tty >/dev/null; then case "$TERM" in xterm*) echo -n $'\e[>4n' >/dev/tty ;; esac fi -------------------------------------------------------------------------------