From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Lowe Newsgroups: gmane.emacs.bugs Subject: bug#19870: 24.4.90; tramp sets bad PAGER, commands which reference it fail Date: Sat, 14 Feb 2015 23:56:26 -0500 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1423976729 15087 80.91.229.3 (15 Feb 2015 05:05:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 15 Feb 2015 05:05:29 +0000 (UTC) To: 19870@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Feb 15 06:05:19 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YMrOO-0001wW-IW for geb-bug-gnu-emacs@m.gmane.org; Sun, 15 Feb 2015 06:05:16 +0100 Original-Received: from localhost ([::1]:33563 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YMrON-0001nH-US for geb-bug-gnu-emacs@m.gmane.org; Sun, 15 Feb 2015 00:05:15 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33893) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YMrOG-0001ku-6j for bug-gnu-emacs@gnu.org; Sun, 15 Feb 2015 00:05:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YMrOA-0002Pu-Ts for bug-gnu-emacs@gnu.org; Sun, 15 Feb 2015 00:05:08 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:53017) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YMrOA-0002Pf-PL for bug-gnu-emacs@gnu.org; Sun, 15 Feb 2015 00:05:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YMrOA-0003JE-HA for bug-gnu-emacs@gnu.org; Sun, 15 Feb 2015 00:05:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Richard Lowe Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 15 Feb 2015 05:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 19870 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.142397669412701 (code B ref -1); Sun, 15 Feb 2015 05:05:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 15 Feb 2015 05:04:54 +0000 Original-Received: from localhost ([127.0.0.1]:44257 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YMrO1-0003Im-8f for submit@debbugs.gnu.org; Sun, 15 Feb 2015 00:04:53 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:60363) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YMrNx-0003IX-L8 for submit@debbugs.gnu.org; Sun, 15 Feb 2015 00:04:51 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YMrNn-0002LU-0T for submit@debbugs.gnu.org; Sun, 15 Feb 2015 00:04:44 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:57584) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YMrNm-0002L9-TT for submit@debbugs.gnu.org; Sun, 15 Feb 2015 00:04:38 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33844) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YMrNh-0001Te-LQ for bug-gnu-emacs@gnu.org; Sun, 15 Feb 2015 00:04:38 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YMrNc-0002Jw-L5 for bug-gnu-emacs@gnu.org; Sun, 15 Feb 2015 00:04:33 -0500 Original-Received: from mail-qc0-x22f.google.com ([2607:f8b0:400d:c01::22f]:43583) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YMrFx-0000Ri-5i for bug-gnu-emacs@gnu.org; Sat, 14 Feb 2015 23:56:33 -0500 Original-Received: by mail-qc0-f175.google.com with SMTP id b13so13945133qcw.6 for ; Sat, 14 Feb 2015 20:56:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=richlowe.net; s=mail; h=from:to:subject:date:message-id:user-agent:mime-version :content-type; bh=+NhoWWdTSOPdVsD4iTM+tn4lVoob8w9/NLhbuJ6v7pY=; b=eT7hyrc+t8ZCJ0uvxFiBtQP5Mzs/ZCGBFNQh6DriI1MuGgueozMQTRQ9xA9kioUMPB w5lKru7tMINDxMbUcHbUTKXR5W6kwgb2m2wVYAYD8z2qfByfLT9n2mE1J4DLx2Xqzqoy hnyk91o9EsCt61fH1eBxG4cZExQZ8gph+bjyA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:user-agent :mime-version:content-type; bh=+NhoWWdTSOPdVsD4iTM+tn4lVoob8w9/NLhbuJ6v7pY=; b=eZFanI53BJKh84e/6uEd5nPc31UG1VlB1pQfRyj+xMHbMULKJpQhM6LdPbuQOct/OX Qj6RlX6psBtZa2mRAF+F9POiWKvtOOh9B8bEayuLFmKQG3lRPI1yFEF1jLzmo/1mrnAy eaeg2h0c+tqkNUN8IK/YRMSkbtbwnJss3Cs1S7qTo9/FywSMPm/0oI4PLYVBjgG7hgkP WIqvd3NAiuuAOdZVVk+U5qUzNkFdz/ey7SNtDUzmaKR7erz2Qqa3tpWHUhu/Kc1erKrJ MqMBdLVuKUeqMex750bXVwm5OaEIVrW4dlbqwWg24MPoxulAGV4er5VWoE6TQz3SQtpG ChmA== X-Gm-Message-State: ALoCoQnPHIyli80q2wTaDZZ3rfHQ7dS2gpJQHfx3qRIWOICprbynJHyoYtE7+d5fpgxmS4z/+iRR X-Received: by 10.140.150.149 with SMTP id 143mr14801363qhw.4.1423976191336; Sat, 14 Feb 2015 20:56:31 -0800 (PST) Original-Received: from quisling.home.richlowe.net (pool-108-51-36-186.washdc.fios.verizon.net. [108.51.36.186]) by mx.google.com with ESMTPSA id d186sm2211179qhc.3.2015.02.14.20.56.29 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 14 Feb 2015 20:56:30 -0800 (PST) User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.4.90 (darwin) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:99422 Archived-At: Change ae5602c51c721196922620b263a490137bba7fe0 "Backport Tramp changes from trunk." contained a chunk like this: diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 6f55b86..1976e0e 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -3967,15 +4076,22 @@ process to set up. VEC specifies the connection." (let ((env (append (when (tramp-get-remote-locale vec) ; Discard `(nil)'. `(,(tramp-get-remote-locale vec))) (copy-sequence tramp-remote-process-environment))) - unset item) + unset vars item) (while env (setq item (tramp-compat-split-string (car env) "=")) (setcdr item (mapconcat 'identity (cdr item) "=")) (if (and (stringp (cdr item)) (not (string-equal (cdr item) ""))) - (tramp-send-command - vec (format "%s=%s; export %s" (car item) (cdr item) (car item)) t) + (push (format "%s %s" (car item) (cdr item)) vars) (push (car item) unset)) (setq env (cdr env))) + (when vars + (tramp-send-command + vec + (format "while read var val; do export $var=$val; done <<'%s'\n%s\n%s" + tramp-end-of-heredoc + (mapconcat 'identity vars "\n") + tramp-end-of-heredoc) + t)) (when unset (tramp-send-command vec (format "unset %s" (mapconcat 'identity unset " ")) t)))) Presumably this is tidying as part of: (tramp-open-connection-setup-interactive-shell): Prefer utf-8 coding. (Bug#17859) Where `tramp-remote-process-environment' by default contains "PAGER=\"\"", after this change we will export into the remote environment literally PAGER="\"\"" (that is it will be in the environment, with the value ""). Since "" isn't an application, things which use the pager will then fail, much as if you had done: $ PAGER="\"\"" git log You can reproduce this by running emacs -Q, opening a dired on a remote directory under git control (C-x C-d /somehost:/some/directory/in/git), and trying to run 'git show' (M-! git show). This will fail, saying: "": : command not found It's not clear to me whether the change quoted above is somehow flawed, or whether the setting of PAGER in `tramp-remote-process-environment' is flawed. I think the setting is to workaround the fact that if the RHS of the assignment in `tramp-remote-process-environment' is empty, we won't actually do anything (which seems a bit weird, given the number of variables in there that will be ignored), and the new code quoted above results in more faithfully quoting things, triggering the bug. In GNU Emacs 24.4.90.1 (i386-apple-darwin14.0.0, NS apple-appkit-1343.16) of 2015-02-12 on quisling.home Repository revision: ae5602c51c721196922620b263a490137bba7fe0 Windowing system distributor `Apple', version 10.3.1343 Configured using: `configure --with-ns --without-pop' Important settings: locale-coding-system: utf-8-unix Major mode: Fundamental Minor modes in effect: shell-dirtrack-mode: t tooltip-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Tramp: Opening connection for metropolis using scp... Tramp: Sending command `exec ssh -o ControlMaster=auto -o ControlPath='tramp.%r@%h:%p' -o ControlPersist=no -e none metropolis' Tramp: Waiting for prompts from remote shell...done Tramp: Found remote shell prompt on `metropolis' Tramp: Opening connection for metropolis using scp...done ls does not support --dired; see `dired-use-ls-dired' for more details. s-! is undefined Quit Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message rfc822 mml easymenu mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mail-utils tramp-cache tramp-sh tramp tramp-compat auth-source eieio byte-opt bytecomp byte-compile cl-extra cl-loaddefs cl-lib cconv eieio-core gnus-util mm-util mail-prsvr password-cache tramp-loaddefs trampver shell pcomplete comint ansi-color ring format-spec advice help-fns dired time-date tooltip electric uniquify ediff-hook vc-hooks lisp-float-type mwheel ns-win tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process cocoa ns multi-tty emacs) Memory information: ((conses 16 101198 8658) (symbols 48 20448 0) (miscs 40 46 198) (strings 32 21041 5061) (string-bytes 1 641937) (vectors 16 13414) (vector-slots 8 420900 6141) (floats 8 81 271) (intervals 56 1073 223) (buffers 960 14))