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#65604: [PATCH] Display the exit code if the last command failed in Eshell Date: Tue, 29 Aug 2023 18:52:40 -0700 Message-ID: <05108d35-d095-c975-78b8-6b00fc7e6a08@gmail.com> References: <87cyz5wjtm.fsf@mssdvd.com> 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="29070"; mail-complaints-to="usenet@ciao.gmane.io" To: Davide Masserut , 65604@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Aug 30 03:53:15 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 1qbAOR-0007Mb-1S for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 30 Aug 2023 03:53:15 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qbAO8-0000Pc-EB; Tue, 29 Aug 2023 21:52:56 -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 1qbAO6-0000PU-OB for bug-gnu-emacs@gnu.org; Tue, 29 Aug 2023 21:52:54 -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 1qbAO6-0003i6-GN for bug-gnu-emacs@gnu.org; Tue, 29 Aug 2023 21:52:54 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qbAOD-00074a-OB for bug-gnu-emacs@gnu.org; Tue, 29 Aug 2023 21:53:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jim Porter Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 30 Aug 2023 01:53:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65604 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 65604-submit@debbugs.gnu.org id=B65604.169336037927179 (code B ref 65604); Wed, 30 Aug 2023 01:53:01 +0000 Original-Received: (at 65604) by debbugs.gnu.org; 30 Aug 2023 01:52:59 +0000 Original-Received: from localhost ([127.0.0.1]:51861 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qbAOB-00074J-3X for submit@debbugs.gnu.org; Tue, 29 Aug 2023 21:52:59 -0400 Original-Received: from mail-pg1-x536.google.com ([2607:f8b0:4864:20::536]:45219) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qbAO6-000744-Ro for 65604@debbugs.gnu.org; Tue, 29 Aug 2023 21:52:58 -0400 Original-Received: by mail-pg1-x536.google.com with SMTP id 41be03b00d2f7-565439b6b3fso2107313a12.2 for <65604@debbugs.gnu.org>; Tue, 29 Aug 2023 18:52:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693360361; x=1693965161; darn=debbugs.gnu.org; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=V5kRtvR3dMDuprhKEM/NJzPM55GlkrPZjm1BK4qgRMs=; b=l/CPM4ui8QmxvJocxpcuPL5M9mARB609lcspE4jKODoxeTHGLT+QsQqBWBgBwQUFxC qcOfchLQBhFjkIRBot55d6UdOmfdghT6dC1H+GkFqnG5Ijwnshh4/s7dIu8oeZkQGe0y arOu7fm/dUToXLFd5eACBzXU5vicJxyZdgG7EXqGlUaD9A+FnCAtD/v6PF3gi37ia8yH rlZrro2cAJC25nduJm5mYSwMYrtef72iTarJotGe1YTWfAdaqbZ/pFJMAu7jiataopja q/Aav/xRu0ZwRd3kFZbkoQxw6bAIVq4TI5nbbbuub5poG1UmKfiLXWnnqLW/6FDR16HB 5FUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693360361; x=1693965161; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=V5kRtvR3dMDuprhKEM/NJzPM55GlkrPZjm1BK4qgRMs=; b=DDL2I+Vp1GNzOkz94XCQe1sqXOIdGQ4T2kSN4SAHTe0H/Ne8xsCk3aWkEVwSjIBYqF rW6LmrBvJS9KNdcYv2wZ056S/dLb/V73raPxVWu3TFRBqk3P8r37FzpVUN4blnG4Hve7 dlonMT0uYXGM73VOpDHVnKjoaW96BxeC8pEbLcHuaMOc0tHwCxvKyDdG85JSzMk3ckyU w2d8HGq6Pr5tWV2VzRuiyEFggFN2gBVwh/C8gt9ijaV0amMjVAr3AyHE0JBgGUc6jL9j Irnpkfssg7eMe3Rrzbm0VCwoZtKXvhet3x2hkv08bKe+bHqZo+eH7znZ0lBvTyQwgBci gRUA== X-Gm-Message-State: AOJu0YyvWIeFHtk7IAjxOpB7TJ1ott9PcqcymxPpwWdTz7FJTM6S0Cgf Uwa2AJv8vR0jZ0+XSpEfbDMEnlnr8Fg= X-Google-Smtp-Source: AGHT+IEoD1cU1vrpNZhoG/hEILPzdatRovw4Rx3Gbdqkuw+UBbDW4J005g55tVGaQRYwKxwpSmNzCg== X-Received: by 2002:a17:90a:d494:b0:268:f987:305d with SMTP id s20-20020a17090ad49400b00268f987305dmr891220pju.5.1693360361537; Tue, 29 Aug 2023 18:52:41 -0700 (PDT) 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 d23-20020a17090a115700b00264040322desm244513pje.40.2023.08.29.18.52.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 29 Aug 2023 18:52:41 -0700 (PDT) Content-Language: en-US In-Reply-To: <87cyz5wjtm.fsf@mssdvd.com> 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:268687 Archived-At: On 8/29/2023 3:24 PM, Davide Masserut via Bug reports for GNU Emacs, the Swiss army knife of text editors wrote: > Tags: patch > > There are commands that fail without printing any messages, but set > specific error codes. > > This patch extends the default prompt function to show the exit code of > the previous failed command. Thanks. I think this makes sense as an option, but I wonder if this is the right default place to put it. Instead, what about putting the exit status in the mode-line, like with compilation buffers? Eshell already uses the mode-line to show when a command is running, so I think it's an obvious enhancement to show the status of a command that just finished running. This does mean you don't see the *history* of failed commands, but it still provides useful feedback for users without requiring a change to the prompt (which is a bit more in-your-face). In the future, I hope to make it easier for people to customize the Eshell prompt without writing (as much) Elisp, e.g. by defining it the same way we can define the mode-line. However, I haven't finished up that patch yet, so it's sitting on one of my pile of local branches...