#!/bin/sh if tmux has-session -t:0 >/dev/null; then # switch to it (creating windows interactively doesn't use index 0, so # implicitly reserved for Emacs) tmux select-window -t:0 else # start it if no frame exists yet tmux new-window -t:0 -n Emacs emacsclient -t fi