* [PATCH] adding term/tmux.el
@ 2016-12-27 22:01 Mark Oteiza
0 siblings, 0 replies; only message in thread
From: Mark Oteiza @ 2016-12-27 22:01 UTC (permalink / raw)
To: emacs-devel; +Cc: Daniel Colascione
---
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2016-12-27 22:01 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-27 22:01 [PATCH] adding term/tmux.el Mark Oteiza
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.