summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2020-08-07 11:42:37 -0700
committerSean Whitton <spwhitton@spwhitton.name>2020-08-07 13:19:09 -0700
commit16844794d8b2a50a6e98c457a0ae3ff957f06308 (patch)
treeb1d0c82ee232bf7ad717cbec105b99bce30c0ad4
parentc2f0a1c95410f4cc3bd5b05fb660f2be860330f2 (diff)
downloaddotfiles-16844794d8b2a50a6e98c457a0ae3ff957f06308.tar.gz
use tmuxmacs to get a single Emacs frame in a tmux session
In a text environment, try relying on Emacs tabs rather than multiple frames.
-rw-r--r--.tmux.conf2
-rwxr-xr-xbin/tmuxmacs10
2 files changed, 11 insertions, 1 deletions
diff --git a/.tmux.conf b/.tmux.conf
index 428abba8..3a4fd8cc 100644
--- a/.tmux.conf
+++ b/.tmux.conf
@@ -47,7 +47,7 @@ bind g new-window -c "#{pane_current_path}" "grep --color=always -Eir '(copyrigh
# bind R command-prompt -p "ssh to host" "split-window 'ssh %1'"
# bind r command-prompt -p "ssh to host" "new-window -n %1 'ssh %1'"
# bind E split-window 'emacsclient -amg -t'
-bind e new-window -n emacs "emacsclient -t"
+bind e run-shell tmuxmacs
# bind t new-window -n irssi 'ii'
# ftp-master: tmux setup for NEW processing
diff --git a/bin/tmuxmacs b/bin/tmuxmacs
new file mode 100755
index 00000000..61bc6c52
--- /dev/null
+++ b/bin/tmuxmacs
@@ -0,0 +1,10 @@
+#!/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