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#71554: 29.3; eshell-command async buffer behavior Date: Fri, 5 Jul 2024 22:28:56 -0700 Message-ID: <88dd9e27-6593-db9b-2d17-cd5ae7abf547@gmail.com> References: <87frtfpqyn.fsf@librehacker.com> <87ikyb8igc.fsf@posteo.net> <86tthvwdxp.fsf@gnu.org> <87ed8z8duo.fsf@posteo.net> <87a5jm94b6.fsf@posteo.net> <874j9ogjfo.fsf@posteo.net> <3ed3832f-e874-ab89-52c3-c0c32650cb33@gmail.com> <86o77qbjv9.fsf@gnu.org> <87r0c87a48.fsf@posteo.net> <86plrs75my.fsf@gnu.org> <87r0c8nyp4.fsf@posteo.net> <865xtk6qkl.fsf@gnu.org> <87le2gyqq8.fsf@posteo.net> <87h6d3zz52.fsf@posteo.net> <877cdz7k6g.fsf@posteo.net> <87r0c7xinq.fsf@posteo.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23820"; mail-complaints-to="usenet@ciao.gmane.io" Cc: christopher@librehacker.com, Eli Zaretskii , 71554@debbugs.gnu.org To: Thierry Volpiatto Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jul 06 07:31:28 2024 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 1sPy1A-000649-0C for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 06 Jul 2024 07:31:28 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sPy0j-0007SS-QW; Sat, 06 Jul 2024 01:31:01 -0400 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 1sPy0i-0007S3-4q for bug-gnu-emacs@gnu.org; Sat, 06 Jul 2024 01:31:00 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sPy0h-0003uD-Sx for bug-gnu-emacs@gnu.org; Sat, 06 Jul 2024 01:30:59 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sPy0k-0004Lo-AD for bug-gnu-emacs@gnu.org; Sat, 06 Jul 2024 01:31:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jim Porter Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 06 Jul 2024 05:31:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71554 X-GNU-PR-Package: emacs Original-Received: via spool by 71554-submit@debbugs.gnu.org id=B71554.172024380816409 (code B ref 71554); Sat, 06 Jul 2024 05:31:02 +0000 Original-Received: (at 71554) by debbugs.gnu.org; 6 Jul 2024 05:30:08 +0000 Original-Received: from localhost ([127.0.0.1]:45386 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sPxzs-0004Gb-Cb for submit@debbugs.gnu.org; Sat, 06 Jul 2024 01:30:08 -0400 Original-Received: from mail-pf1-f180.google.com ([209.85.210.180]:44479) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sPxzp-0004FU-V0 for 71554@debbugs.gnu.org; Sat, 06 Jul 2024 01:30:06 -0400 Original-Received: by mail-pf1-f180.google.com with SMTP id d2e1a72fcca58-70b09cb7776so1149322b3a.1 for <71554@debbugs.gnu.org>; Fri, 05 Jul 2024 22:30:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720243736; x=1720848536; darn=debbugs.gnu.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=yF/wozf1FBqrggKJrJ9yiy0Tbl89sNdWuOp2q+bXKJo=; b=Cq5rL3k6KxJsYaar38U65EFnC7mlKnHDz/lO874J9bGXtBOwO+i1dEVQb1ot6xiJXs 5W7biShJcpV0Z5kzcszoCO1E9CSASMjjLFwP+WjKc9ecQs+2k3DUGtanxCGfpBAgD9x/ wuk/rWrjaAT9DoocsVXfv9BYzncXZYEPOPggcMaQc0J1nmPp+n1uEzGv+I1qNoT9JQwb nomftBgvBNadVSgEqrhf6p3lAMABnHTNWkB5bEhXsHMRPV/epFpPDPNZKzQNY3cC4QWj nBmR1ZkPjGchdnvCggKBVNztuXHw5uoyWFSWFT5Sn3VbDVXKa43vpHa2uAEKhg/SiQVc kAGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720243736; x=1720848536; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=yF/wozf1FBqrggKJrJ9yiy0Tbl89sNdWuOp2q+bXKJo=; b=v+Ko6fFrzYWVl88BK4OU2qKn/mAZmSC9cOJYwgqieKH8NRY5MOScLkBOYCO/lohGcR zDUitf2Iq/dvfI5K3bDoA5Zs3QVGkQQIY3nmpqRL0vloDVxwzupbN7FMS6xZOVd5M8+l IrLjxwfYQbduBH3dfN24M++0Yvbb4apXJfK4rGyMKwBEtLktKdizWazJytaL5ZNTYN0c JdNmRwLVd9mAxbOtfy1hVMziT62ufx87jjvIFAHqGS/dRGaMIWsy/vrA54BxmmXOId2l Cwnn6PeBEDBFc4qFmgaRq80Ri3e+xf30UhASHkf4TFGxbrlmzOiaWRaUmtGyd/zxac/C 3bRA== X-Forwarded-Encrypted: i=1; AJvYcCWYngY36W40jeubn7zY/I/uh+Sg3pGoNjojoItc84hHeFKzH4VfhRgMgAyIGG4br7t2k4V+DeERXsuBm1UZou2Z4mirRK8= X-Gm-Message-State: AOJu0YxHgh6dVIcwBGX+kmXMITjNc/A15nQgDWhnAVTno8dVCaB/leTu atafudStxY/iTA4qx/9nuJ/2Zw+R5VBQPXZzuWzr6sXaN0dxtS3U X-Google-Smtp-Source: AGHT+IFKIrKifwUsrziHZDsu05kGn6m6YkjqlD7xMLkm8oEarnIsexlK7tRAGOH7B/cCrzEEdl/Okg== X-Received: by 2002:a05:6a20:12d5:b0:1bd:232a:946f with SMTP id adf61e73a8af0-1c0cc75dd68mr6978231637.34.1720243736446; Fri, 05 Jul 2024 22:28:56 -0700 (PDT) Original-Received: from [192.168.1.2] (syn-023-240-098-037.res.spectrum.com. [23.240.98.37]) by smtp.googlemail.com with ESMTPSA id d9443c01a7336-1fb4701d45dsm24357555ad.190.2024.07.05.22.28.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 05 Jul 2024 22:28:56 -0700 (PDT) Content-Language: en-US In-Reply-To: <87r0c7xinq.fsf@posteo.net> 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:288452 Archived-At: On 7/5/2024 9:12 PM, Thierry Volpiatto wrote: > (cond > ((with-current-buffer bufname > (and (null eshell-foreground-command) > (null eshell-background-commands))) > ;; The old buffer is done executing; kill it so we can > ;; take its place. > (kill-buffer bufname)) > > What if user ran a serie of commands and want to see the output of each > one? I did that to preserve the logic of 'shell-command': if there's no running process in the buffer, it will get reused. That's the Eshell-ified analogue to this bit in 'shell-command': ;; Ask the user what to do with already running process. (when proc ;; <-- This line. (cond ((eq async-shell-command-buffer 'confirm-kill-process) ... Is that always what users want? Hard to say. Still, I think behaving like 'shell-command' is a good thing in order to follow the principle of least surprise. (If we changed the behavior in 'eshell-command', I think we'd want to do the same in 'shell-command' too.) For users who *do* want something like that behavior, I think there are two options: 1. You could redirect the output in the Eshell command you enter at the prompt. For example: do-something &> (generate-new-buffer "mybuf") & That would put the output from "do-something" into a unique buffer, running it asynchronously. (It wouldn't display the buffer by default, though with a bit of Elisp you could make it do that too.) 2. We could patch 'eshell-command' to be more like 'shell-command', and have a signature like: (defun eshell-command (command &optional output-buffer error-buffer) ...) That way, you could output to a unique buffer (or any Eshell target, in fact) by passing it as an argument. I have a WIP patch to add this.