From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Mark Oteiza Newsgroups: gmane.emacs.devel Subject: [PATCH] adding term/tmux.el Date: Tue, 27 Dec 2016 17:01:48 -0500 Message-ID: <20161227220148.GA16946@holos.localdomain> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1482876165 24409 195.159.176.226 (27 Dec 2016 22:02:45 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 27 Dec 2016 22:02:45 +0000 (UTC) User-Agent: Mutt/1.7.2+8 (b112fd7061fb) (2016-11-26) Cc: Daniel Colascione To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Dec 27 23:02:40 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cLzpK-00057v-EQ for ged-emacs-devel@m.gmane.org; Tue, 27 Dec 2016 23:02:34 +0100 Original-Received: from localhost ([::1]:56446 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cLzpP-0005RY-6S for ged-emacs-devel@m.gmane.org; Tue, 27 Dec 2016 17:02:39 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35536) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cLzoi-0005PN-UU for emacs-devel@gnu.org; Tue, 27 Dec 2016 17:01:57 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cLzoe-000090-T0 for emacs-devel@gnu.org; Tue, 27 Dec 2016 17:01:57 -0500 Original-Received: from mail-qk0-x22f.google.com ([2607:f8b0:400d:c09::22f]:36598) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cLzoe-00008W-O2 for emacs-devel@gnu.org; Tue, 27 Dec 2016 17:01:52 -0500 Original-Received: by mail-qk0-x22f.google.com with SMTP id n21so225472099qka.3 for ; Tue, 27 Dec 2016 14:01:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=udel-edu.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=Qlb42GswfKT9SbnFusHN2P2zkP6MDKxKORCn+r6ftH8=; b=0I6scOIdBx08FZbB/krhvx0gUm6WC9V8K1BnD182czdOiAWLKhaWjh/GrCAvuxFmHz SN1ljc9396S2a5vLca8pqYyrD6QGab0CjkPGwjKtdPraEL2zPWN9hp9yTSzvhBjGfCGG xky088UGVt7BezaUPM+4Uy6ThDbMr7owI1Q5hGo/IeOC/R7E2kI/YI4Hy7G2Q7FuQlaX sZHhczdVd1u/grwBA35dAf2PICU6QEWBVpapicP1GQqcMQniBMQbuZEAtjwTci0tN6J+ 9ZOwSlPjyWNanFUkrD5XQ6zKMAfCWxUslmQer1SgdSH6bGUn9s+gqFIDAPM7/lGZfmj9 lNOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=Qlb42GswfKT9SbnFusHN2P2zkP6MDKxKORCn+r6ftH8=; b=D8eTbNFh4B+QarLDVhlTA5IPtM/ziufcv+jfRo0OiQbZM3hXM+baReBc4ygiKRg4sZ +S+QoAXPGMYBL740TMTZ3viOg2Y0Nuy902nikW6qQBoO2IZxMpT1HbAKRJGFLA2gMnm1 dhOCI/7TjYnSGhfWC7/6EWagcDnDrY911K0ukPSBPLB9pDOF9weuqsJ3jCCoiBjg6nzp SJNPVdI4kWv7j9sRGEyCYIq+5JfbZY0TAQsTluT3+q/7IsnEEL+zw03YuOhx7d0TS+bi cGSG/YrW7CUmWvLO6bU8GgECiiKxC0QrCiTzOt9KzLJbUUVCxdjldQfb5C8pEzKLXYbx BdFQ== X-Gm-Message-State: AIkVDXIxqTYSuKtjODwHF2q9u1ndetHULSQZ34ILDzjL5yWO+ZSwaVFW6Vml7YDDlfNKtLok X-Received: by 10.55.129.194 with SMTP id c185mr32599220qkd.0.1482876110049; Tue, 27 Dec 2016 14:01:50 -0800 (PST) Original-Received: from holos.localdomain ([69.250.222.218]) by smtp.gmail.com with ESMTPSA id m30sm29262742qta.7.2016.12.27.14.01.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Dec 2016 14:01:48 -0800 (PST) Original-Received: by holos.localdomain (Postfix, from userid 1000) id 1FAF066143; Tue, 27 Dec 2016 17:01:48 -0500 (EST) Content-Disposition: inline X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400d:c09::22f X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:210853 Archived-At: --- 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