emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] adding term/tmux.el


From: Mark Oteiza
Subject: [PATCH] adding term/tmux.el
Date: Tue, 27 Dec 2016 17:01:48 -0500
User-agent: Mutt/1.7.2+8 (b112fd7061fb) (2016-11-26)

---

Since tmux 2.1[0], now ships its own terminfo for reasons[1,2], so Emacs
ought to recognize it.

I did the lazy thing and just duplicated screen.el.  Perhaps there is
a better way to do it, but I don't know how the term machinery works
anyways.

[0] https://raw.githubusercontent.com/tmux/tmux/master/CHANGES
[1] https://github.com/ThomasAdam/tmux/blob/master/FAQ#L355
[2] https://github.com/tmux/tmux/issues/175

 lisp/term/tmux.el | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/lisp/term/tmux.el b/lisp/term/tmux.el
new file mode 100644
index 0000000000..60d18d7329
--- /dev/null
+++ b/lisp/term/tmux.el
@@ -0,0 +1,25 @@
+;;; tmux.el --- terminal initialization for tmux  -*- lexical-binding: t -*-
+;; Copyright (C) 2017 Free Software Foundation, Inc.
+
+(require 'term/xterm)
+
+(defcustom xterm-tmux-extra-capabilities '(modifyOtherKeys)
+  "Extra capabilities supported under \"tmux\".
+Some features of tmux depend on the terminal emulator in which
+it runs, which can change when the tmux session is moved to another tty."
+  :version "26.1"
+  :type xterm--extra-capabilities-type
+  :group 'xterm)
+
+(defun terminal-init-tmux ()
+  "Terminal initialization function for tmux."
+  ;; Treat a tmux terminal similar to an xterm, but don't use
+  ;; xterm-extra-capabilities's `check' setting since that doesn't seem
+  ;; to work so well (it depends too much on the surrounding terminal
+  ;; emulator, which can change during the session, bug#20356).
+  (let ((xterm-extra-capabilities xterm-tmux-extra-capabilities))
+    (tty-run-terminal-initialization (selected-frame) "xterm")))
+
+(provide 'term/tmux)
+
+;; tmux.el ends here



reply via email to

[Prev in Thread] Current Thread [Next in Thread]