#!/bin/bash # Store a reference of the terminal emacsclient is attached to. TTY=/tmp/s.emacs.`whoami`.tty tty >$TTY # xterm seems also OK, so translate. [ "$TERM" == xterm ] && TERM=xterm-256color # Make sure it's there emacs-check # Attach to emacs exec emacsclient -t "$@"