Xterm

From wikinotes

Xterm is bundled with Xorg, making it the most universally available terminal across linux/bsd.


WARNING:

Some xterm key sequences are used for internal functions, preventing them from being sent to your application.


Locations

~/.Xresources main configfile

Colorschemes

gogh colorschemes collection https://gogh-co.github.io/Gogh/

Loading Xresources

xrdb ~/.Xresources


Configuration

! ====
! Font
! ====
XTerm.vt100.faceName: Droid Sans Mono:size=12:antialias=true
XTerm.termName: xterm-256color


! ================
! Terminal Options
! ================

! Alt behaves like other terminals
XTerm.vt100.metaSendsEscape: true

! Fix Backspace (and vim alt+[a-z] hotkeys)
XTerm.vt100.backarrowKey: false
XTerm.ttyModes: erase ^?<Paste>

! Lines to scroll
XTerm.vt100.saveLines: 4096

! =======
! Hotkeys
! =======
!
XTerm.VT100.translations: #override \
   Ctrl <Key> minus: smaller-vt-font() \n\
   Ctrl <Key> plus: larger-vt-font() \n


! ======
! Colors
! ======

XTerm.vt100.foreground: #A8A99B
XTerm.vt100.background: #272822

XTerm.vt100.color0: #000000
XTerm.vt100.color1: #A93025
XTerm.vt100.color2: #93D44F
XTerm.vt100.color3: #EAB93D
XTerm.vt100.color4: #306A87
XTerm.vt100.color5: #CE5C00
XTerm.vt100.color6: #89B6E2
XTerm.vt100.color7: #CCCCCC


XTerm.vt100.color8: #555753
XTerm.vt100.color9: #ff8d8d
XTerm.vt100.color10: #40a030
XTerm.vt100.color11: #ffc123
XTerm.vt100.color12: #3465a9
XTerm.vt100.color13: #f57900
XTerm.vt100.color14: #46a4ff
XTerm.vt100.color15: #ffffff

Translations (hotkeys)

Xterm binds hotkeys to keysequences.
This is useful for tasks like dynamically resizing the font
This can also be undesirable, preventing keysequences from ever reaching your terminal application.

# example resizing keys
XTerm.VT100.translations: #override \
   Ctrl <Key> minus: smaller-vt-font() \n\
   Ctrl <Key> plus: larger-vt-font() \n

Syntax

# binding keys
Ctrl Alt <KeyPress> h:  {action}\n   # ctrl + alt + h
~Ctrl Alt <KeyPress> h: {action}\n   # NOT-ctrl, alt + h

# sending keys
# see ASCII-table https://www.systutorials.com/ascii-table-and-ascii-code/
# also use `showkey -a` to see keycodes
Ctrl Meta <KeyPress> h: string("0x4f")                 # single-key -- type 'o' (ascii code) when 'Ctrl+Alt+h' is pressed
Ctrl Meta <KeyPress> h: string("0x1b") string("0x08")  # multi-key -- type <Esc> followed by comma
<Key>Delete: string(0x1b) string("[3~")                # delete sends instructions to delete

Transparency

xterm does not natively support transparency, but with a delay you can make the active window transparent.

xterm & sleep .1s && transset -a 0.95