pizza slow (high quality)

Contents

mirrored image from https://66.media.tumblr.com/bd2987bff9bec9c2cb7e6c97da48b757/tumblr_inline_mpj10uWXun1qz4rgp.jpg without alt text, sorry

Xterm Inception

Or, How to Use Xterm Mice and Colors in Fish Through iTerm2 Over Mosh (over ssh) in Tmux on Remote Vim and Weechat Terminals.

Inception levels

  1. Reality
  2. iTerm2
  3. fish
  4. ssh
  5. mosh
  6. fish
  7. tmux
  8. vim, weechat, etc
  9. Dream level 1 and so on.

Configuring it all

  1. Configure iTerm2 to report itself as an xterm-256color and enable mouse control codes.

  2. Ensure your shell’s $TERM recognizes it. You shouldn’t have to force this with any shell init junk.

  3. Execute this perl one liner to print the XTerm control sequences to “Use Cell Motion Mouse Tracking” (1002) and “Enable UTF-8 Mouse Mode” (1005). Consider wrapping mosh in something that does this for you.

    perl -E ' print "\e[?1005h\e[?1002h" '
    
  4. mosh to the remote host.

  5. Configure remote tmux to support mice. Add the following to ~/.tmux.conf

    set -g default-terminal "screen-256color"   # use 256 colors
    set -g status-utf8 on                       # enable utf-8
    set -g mode-mouse on
    
  6. Configure vim to follow suit. Add the following to your ~/.vimrc

    set mouse=a
    set ttymouse=xterm2
    
  7. Configure weechat to do the same in ~/.weechat/weechat.conf.

    mouse = on
    

A Weird olde tip

Hold option to use your mouse on your local terminal instead of the remote one.

July 3rd, 2013 9:11am

Proximate posts in the Tumblr collection
newer Post #54812812019 07 July 2013
this post Post #54518878156 03 July 2013
older Post #54167201205 29 June 2013
Proximate posts in the General collection
newer Twitter post from July 4, 2013, 352634329245024256 04 July 2013
this post Post #54518878156 03 July 2013
older Twitter post from July 3, 2013, 352446067591217153 03 July 2013