From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jim Porter Newsgroups: gmane.emacs.bugs Subject: bug#61024: 29.0.60; [PATCH] Eshell errors out when trying to redirect output of a remote process Date: Sun, 22 Jan 2023 23:07:58 -0800 Message-ID: <230f0e06-f47a-6a0d-93de-222ca16f7213@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------AYKUWkCBVEsDuyOisI0R6Yay" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19135"; mail-complaints-to="usenet@ciao.gmane.io" To: 61024@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jan 23 08:09:21 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pJqxE-0004qG-MH for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 23 Jan 2023 08:09:20 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pJqwy-00085a-Hx; Mon, 23 Jan 2023 02:09:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pJqwx-00085J-5M for bug-gnu-emacs@gnu.org; Mon, 23 Jan 2023 02:09:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pJqww-00035r-NO for bug-gnu-emacs@gnu.org; Mon, 23 Jan 2023 02:09:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pJqww-0002d2-HW for bug-gnu-emacs@gnu.org; Mon, 23 Jan 2023 02:09:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Jim Porter Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 23 Jan 2023 07:09:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 61024 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.167445768610034 (code B ref -1); Mon, 23 Jan 2023 07:09:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 23 Jan 2023 07:08:06 +0000 Original-Received: from localhost ([127.0.0.1]:53161 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pJqw1-0002bl-PX for submit@debbugs.gnu.org; Mon, 23 Jan 2023 02:08:06 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:39728) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pJqvy-0002bc-My for submit@debbugs.gnu.org; Mon, 23 Jan 2023 02:08:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pJqvy-0007z9-G6 for bug-gnu-emacs@gnu.org; Mon, 23 Jan 2023 02:08:02 -0500 Original-Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pJqvw-0002wr-S0 for bug-gnu-emacs@gnu.org; Mon, 23 Jan 2023 02:08:02 -0500 Original-Received: by mail-pf1-x42a.google.com with SMTP id x4so8085960pfj.1 for ; Sun, 22 Jan 2023 23:08:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:from:content-language:mime-version:date:message-id:from :to:cc:subject:date:message-id:reply-to; bh=H04qXuqWAKSjAtzCBBnc+Wz5Mlh6wRe6pl6GY7C+myo=; b=FYmL9BRcCB/uYRSBd57kHGWRjh2Tsa6d+IVa1TNyxzvGUJepsSPaw8wUyWtg8rq7QS hmVam14zT2stkV19cUvhsVN8KisKvCgtYiy0rNhnWGususPytJNCp6BPK5ZDRWIMwNW/ 0SWY5nGh/tEM1ztRIM3B1YJyRvimhtvcFaAsI798Rc7S7bz1diMNnQt2qUDw6T4Y0uui 8fjwWrMKA5NPxcc+HeQA6bYsxGftne1cXwSlL5UsIKMDXuj0pb2ja8vQiaH9JKcDOCQ0 EpgRBFtwDLmTzaJjFxYA1nzCZtyWSnRhih6IvL62COAOtd0XXgmMTr/u3Vt1fRuOJ0UR RRHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:from:content-language:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=H04qXuqWAKSjAtzCBBnc+Wz5Mlh6wRe6pl6GY7C+myo=; b=MmnLbI99SxaOFxXtxfO315ckzOe1sdj/fZ0Frn2jrUMPj7jwrvzgZ5bVjoKzqqy75K bjYmwykbxhl7nnvMdtnDTilDh4mpjFe3uvjAg+5aXJX+BKH3PmBQIcRRw3aPLuryblZV dLruZ2aEyg7Qn29Szogo1RumnfMmkvv4SCJ/vpg6pAoAgQTD/LitMdjE4LtXw0vTptD5 P3dNSiGlFvO13+V3mHHzXHggyQS0ocK91O9TCQi8d2HpN9jgr+6GpoQySfHimKTvr/6x m3VSKtHfJchzBqwbLtaqDEOTXTshKVDtYaxDgY/ITeudgHcG402P/GBSJXu3UgKUMH5D trzQ== X-Gm-Message-State: AFqh2kqFzSUzmTitr+q93w5LUK6bw2N++jJXD/tGSlyWvOVxnIY+Ij5F SzyxB3EQf91s70hvOwSRwQ5m07ZRK7zIcA== X-Google-Smtp-Source: AMrXdXvZmK2h63q/NYt/4i+f51AZBwqLSiEAWp8kPIRLUuva2SCdstlS9f1HPkU8vA6L2fAHzx+HXA== X-Received: by 2002:aa7:9892:0:b0:583:4126:a09 with SMTP id r18-20020aa79892000000b0058341260a09mr23444568pfl.21.1674457679242; Sun, 22 Jan 2023 23:07:59 -0800 (PST) Original-Received: from [192.168.1.2] (cpe-76-168-148-233.socal.res.rr.com. [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id e30-20020a056a0000de00b0058d54960eccsm15650575pfj.151.2023.01.22.23.07.58 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 22 Jan 2023 23:07:58 -0800 (PST) X-Mozilla-News-Host: news://news.gmane.io:119 Content-Language: en-US Received-SPF: pass client-ip=2607:f8b0:4864:20::42a; envelope-from=jporterbugs@gmail.com; helo=mail-pf1-x42a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:253980 Archived-At: This is a multi-part message in MIME format. --------------AYKUWkCBVEsDuyOisI0R6Yay Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit To see this in action, run "emacs -Q -f eshell" and then: ~ $ cd /sudo:: /sudo:root@host:~ # *echo hi there > # Wrong type argument: "bufferp echo-stderr" (Any other Tramp method should reproduce this issue.) That's because the echo command is being redirected to two places: stdout is going to the buffer "foo", and stderr is going to the Eshell buffer (via a pipe process). However, that doesn't work for Tramp processes. Attached is a fix with a test. I think this should definitely go in Emacs 29, since it's a pretty bad regression. I'm actually surprised no one has filed a bug on this already. For tracking purposes, I believe this was broken by f07505d1ec (bug#21605). For Emacs 30, it'd be interesting to see if there were a way to get Tramp processes to have different targets for stdout and stderr. That'd make them work a lot more like local processes in Eshell. --------------AYKUWkCBVEsDuyOisI0R6Yay Content-Type: text/plain; charset=UTF-8; name="0001-Don-t-try-to-make-a-pipe-process-for-remote-processe.patch" Content-Disposition: attachment; filename*0="0001-Don-t-try-to-make-a-pipe-process-for-remote-processe.pa"; filename*1="tch" Content-Transfer-Encoding: base64 RnJvbSA2OGZlYmNmOWY1ZTU5OTkzOTFlMmVjN2E4YmI4ZjU0NWI5N2VkN2ZlIE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBKaW0gUG9ydGVyIDxqcG9ydGVyYnVnc0BnbWFpbC5j b20+CkRhdGU6IFN1biwgMjIgSmFuIDIwMjMgMjI6NTQ6NTMgLTA4MDAKU3ViamVjdDogW1BB VENIXSBEb24ndCB0cnkgdG8gbWFrZSBhIHBpcGUgcHJvY2VzcyBmb3IgcmVtb3RlIHByb2Nl c3NlcyBpbgogRXNoZWxsCgpUcmFtcCBjdXJyZW50bHkgaXNuJ3QgYWJsZSB0byBoYW5kbGUg dGhpcywgc28gdGhlIHJlc3VsdCB3aWxsIGp1c3QKcHJvZHVjZSBhbiBlcnJvci4KCiogbGlz cC9lc2hlbGwvZXNoLXByb2MuZWwgKGVzaGVsbC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