magbo system

From xterm to Termite and back

Not long ago I heard about Termite terminal emulator. It is inspired by Vim and that’s why I wanted to try it. Sadly Debian hasn’t package so I needed build it from source.

Termite has useful keyboard shortcuts. For me are important:

  • ctrl + shift + up: scroll up a line
  • ctrl + shift + down: scroll down a line
  • ctrl + +: increase font size
  • ctrl + -: decrease font size

And in selection mode:

  • v: visual mode
  • shift + v: visual line mode
  • ctrl + v: visual block mode
  • y: copy to clipboard
  • /: search
  • and others shorcuts from Vim

By default Termite has nice dark theme. But there are two problems.

The first one appeard after SSH connection. Remote server doesn’t know termite terminal and I must set and export TERM variable after every connection. The solution is to install termite.terminfo on each remote server you will work.

The second problem is noticeable slowdown of the terminal. It is visible during a scrolling. It’s a little bit slower than xterm but it is visible.

I came back to xterm and set some features from Termite. Look at my ~/.Xresources:

XTerm*foreground:silver
XTerm*background:grey23
XTerm*vt100.charClass: 33:48,35:48,37:48,42:48,45-47:48,64:48,95:48,126:48
XTerm.vt100.metaSendsEscape: true

! Font
XTerm.vt100.faceName: Monospace:size=16:antialias=true

! Change font size
XTerm.VT100.Translations: #override \n\
  Ctrl <Key> plus: larger-vt-font() \n\
  Ctrl <Key> minus: smaller-vt-font()

! Scroll by one line
XTerm.VT100.translations: #override \
  Shift <Key>Up: scroll-back(1) \n\
  Shift <Key>Down: scroll-forw(1)

Termite can select text with keyboard and xterm doesn’t. This issue I solve with tmux multiplexer. Here is my ~/.tmux.conf:

# To enable ctrl + arrows and alt + arrows in new Vim
set-option -g default-terminal "xterm-256color"
set-window-option -g xterm-keys on

# I want xterm mouse style without shift key
set -g mouse off

# Copy to clipboard and paste from clipboard
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "xsel -i -p && xsel -o -p | xsel -i -b"
bind-key p run "xsel -o | tmux load-buffer - ; tmux paste-buffer"

Leave a Reply

Your email address will not be published. Required fields are marked *