From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#35055: 27.0.50; async-shell-command truncates output lines Date: Mon, 08 Apr 2019 23:23:46 +0300 Organization: LINKOV.NET Message-ID: <87mul0tfe5.fsf@mail.linkov.net> References: <87tvfkuivn.fsf@mail.linkov.net> <875zrym4eo.fsf@gmx.de> <877ecd797c.fsf@mail.linkov.net> <87y34s21vp.fsf@gmx.de> <87zhp6vmu5.fsf@mail.linkov.net> <87r2ah32rr.fsf@mail.linkov.net> <878swopr3p.fsf@gmx.de> <87y34mc13t.fsf@mail.linkov.net> <874l7ajmnx.fsf@gmx.de> <87lg0l1syw.fsf@mail.linkov.net> <87v9zpgd3t.fsf@gmx.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="266727"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) Cc: 35055@debbugs.gnu.org To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Apr 08 22:29:25 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hDatQ-0017FF-JM for geb-bug-gnu-emacs@m.gmane.org; Mon, 08 Apr 2019 22:29:25 +0200 Original-Received: from localhost ([127.0.0.1]:58539 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hDatP-0006ME-3Z for geb-bug-gnu-emacs@m.gmane.org; Mon, 08 Apr 2019 16:29:23 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:59254) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hDatB-0006Jc-21 for bug-gnu-emacs@gnu.org; Mon, 08 Apr 2019 16:29:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hDat9-0007WC-Sv for bug-gnu-emacs@gnu.org; Mon, 08 Apr 2019 16:29:09 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36676) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hDat7-0007Uh-4A for bug-gnu-emacs@gnu.org; Mon, 08 Apr 2019 16:29:06 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hDat6-000590-V2 for bug-gnu-emacs@gnu.org; Mon, 08 Apr 2019 16:29:05 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 08 Apr 2019 20:29:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35055 X-GNU-PR-Package: emacs Original-Received: via spool by 35055-submit@debbugs.gnu.org id=B35055.155475533519727 (code B ref 35055); Mon, 08 Apr 2019 20:29:04 +0000 Original-Received: (at 35055) by debbugs.gnu.org; 8 Apr 2019 20:28:55 +0000 Original-Received: from localhost ([127.0.0.1]:50216 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hDasw-000587-Mq for submit@debbugs.gnu.org; Mon, 08 Apr 2019 16:28:55 -0400 Original-Received: from bonobo.maple.relay.mailchannels.net ([23.83.214.22]:44059) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hDasu-00057v-8Y for 35055@debbugs.gnu.org; Mon, 08 Apr 2019 16:28:53 -0400 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 0D9D65C2CC6; Mon, 8 Apr 2019 20:28:51 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a91.g.dreamhost.com (unknown [100.96.11.48]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id B07DB5C51FA; Mon, 8 Apr 2019 20:28:50 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a91.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.17.2); Mon, 08 Apr 2019 20:28:51 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Sponge-Shrill: 0ca7a87b61675e0e_1554755330879_756281822 X-MC-Loop-Signature: 1554755330879:1798800607 X-MC-Ingress-Time: 1554755330878 Original-Received: from pdx1-sub0-mail-a91.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a91.g.dreamhost.com (Postfix) with ESMTP id 55C897FA63; Mon, 8 Apr 2019 13:28:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=7dMGQIhX5n4OI48Z7MLyk3aK3n0=; b= WAnzZwsiuwlQuU3fDd81Cc1o9ki7uQZy/MmYwB4F6unR/fVdeGFPSZtgnHqYipT/ G8NVNY/vBJkZK0sB8sD69n2557Gwv0A1IDkutO8rFi5lUnDEIuXRPcmKR5q2Rp7/ baHp6O3QxQukR1WIiyu3RDG9YADGvgzqlbIFxYgH5Q0= Original-Received: from mail.jurta.org (m91-129-99-202.cust.tele2.ee [91.129.99.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a91.g.dreamhost.com (Postfix) with ESMTPSA id 48CB27FA61; Mon, 8 Apr 2019 13:28:47 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a91 In-Reply-To: <87v9zpgd3t.fsf@gmx.de> (Michael Albinus's message of "Mon, 08 Apr 2019 09:39:18 +0200") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduuddrudefgdduhedvucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufhofhffjgfkfgggtgesmhdtreertdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrdelledrvddtvdenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepmhgrihhlrdhjuhhrthgrrdhorhhgpdhinhgvthepledurdduvdelrdelledrvddtvddprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopehmihgthhgrvghlrdgrlhgsihhnuhhssehgmhigrdguvgenucevlhhushhtvghrufhiiigvpedt X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.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" Xref: news.gmane.org gmane.emacs.bugs:157359 Archived-At: --=-=-= Content-Type: text/plain >>> If you add "COLUMNS=1024" to tramp-remote-process-environment, you would >>> get this effect already w/o any change in Tramp. Maybe I shall document >>> it somewhere in the Tramp manual. >> >> It seems it's impossible to set COLUMNS to the width of the output window >> neither in Tramp nor in async-shell-command. shell-mode can do this >> using set-process-window-size. But Tramp can't do the same for the >> remote process, and for async-shell-command it's too late to do this >> because when it displays a window with the output buffer, >> the command is already finished. > > Again, using tramp-remote-process-environment seems to be the > appropriate place. Thanks for the suggestion, I customized it to '("COLUMNS=222") that is approximately equal to my frame's width, thus `ps` shows enough output, and `dpkg -l '*emacs*'` is not too wide ('dpkg' tries to fill all available columns). Should a similar option be added for async-shell-command as well? --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=async-shell-command-width.patch diff --git a/lisp/simple.el b/lisp/simple.el index 857e0fc001..7212686add 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -3336,6 +3336,15 @@ async-shell-command-display-buffer :group 'shell :version "26.1") +(defcustom async-shell-command-width nil + "Number of columns available for shell command. +If nil, use the shell default number (usually 80). +If a positive integer, use a fixed width." + :type '(choice (const :tag "Use system limit" nil) + (integer :tag "Fixed width" :value 80)) + :group 'shell + :version "27.1") + (defcustom shell-command-dont-erase-buffer nil "If non-nil, output buffer is not erased between shell commands. Also, a non-nil value sets the point in the output buffer @@ -3599,8 +3608,13 @@ shell-command (with-current-buffer buffer (shell-command--save-pos-or-erase) (setq default-directory directory) - (setq proc - (start-process-shell-command "Shell" buffer command)) + (let ((process-environment + (if (natnump async-shell-command-width) + (cons (format "COLUMNS=%d" async-shell-command-width) + process-environment) + process-environment))) + (setq proc + (start-process-shell-command "Shell" buffer command))) (setq mode-line-process '(":%s")) (require 'shell) (shell-mode) (set-process-sentinel proc #'shell-command-sentinel) --=-=-=--