all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Mark Oteiza <mvoteiza@udel.edu>
To: emacs-devel@gnu.org
Cc: Daniel Colascione <dancol@dancol.org>
Subject: [PATCH] adding term/tmux.el
Date: Tue, 27 Dec 2016 17:01:48 -0500	[thread overview]
Message-ID: <20161227220148.GA16946@holos.localdomain> (raw)

---

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	other threads:[~2016-12-27 22:01 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161227220148.GA16946@holos.localdomain \
    --to=mvoteiza@udel.edu \
    --cc=dancol@dancol.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.