GNU bug report logs - #1975
Reusing dead shell buffers

Previous Next

Package: emacs;

Reported by: jemarch <at> gnu.org

Date: Wed, 21 Jan 2009 05:25:04 UTC

Severity: wishlist

Tags: patch

Done: Chong Yidong <cyd <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 1975 in the body.
You can then email your comments to 1975 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report stored :
bug#1975; Package emacs. (Wed, 21 Jan 2009 05:25:04 GMT) Full text and rfc822 format available.

Message #3 received at quiet <at> emacsbugs.donarmstrong.com (full text, mbox):

From: jemarch <at> gnu.org
To: quiet <at> debbugs.gnu.org
Subject: Reusing dead shell buffers
Date: Sun, 11 Jan 2009 21:19:21 +0100
Severity: wishlist

[ resent from
  http://lists.gnu.org/archive/html/emacs-devel/2009-01/msg00295.html ]

Hi.

Just a tiny patch for shell.

The patch assumes that the person launching M-xshell while in a
shell-mode buffer with a terminated process really wants to launch a
shell process in the current buffer instead to switch to "*shell*".

The semantics of C-uM-xshell are not changed by the patch.

Index: shell.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/shell.el,v
retrieving revision 1.165
diff -u -r1.165 shell.el
--- shell.el	5 Jan 2009 03:19:45 -0000	1.165
+++ shell.el	11 Jan 2009 19:46:35 -0000
@@ -555,6 +555,9 @@
 		      (read-file-name
 		       "Default directory: " default-directory default-directory
 		       t nil 'file-directory-p))))))))
+  ;; If the current buffer is a dead shell buffer, use it.
+  (if (and (not buffer) (eq major-mode 'shell-mode))
+      (setq buffer (current-buffer)))
   (setq buffer (get-buffer-create (or buffer "*shell*")))
   ;; Pop to buffer, so that the buffer's window will be correctly set
   ;; when we call comint (so that comint sets the COLUMNS env var properly).




Added tag(s) patch. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Wed, 20 Jan 2010 01:41:02 GMT) Full text and rfc822 format available.

Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#1975; Package emacs. (Sat, 10 Apr 2010 19:27:02 GMT) Full text and rfc822 format available.

Message #8 received at 1975 <at> debbugs.gnu.org (full text, mbox):

From: Chong Yidong <cyd <at> stupidchicken.com>
To: jemarch <at> gnu.org
Cc: 1975 <at> debbugs.gnu.org
Subject: Re: Reusing dead shell buffers
Date: Sat, 10 Apr 2010 15:26:56 -0400
> Just a tiny patch for shell.
>
> The patch assumes that the person launching M-xshell while in a
> shell-mode buffer with a terminated process really wants to launch a
> shell process in the current buffer instead to switch to "*shell*".
>
> The semantics of C-uM-xshell are not changed by the patch.

Could you explain why you think this is necessary?  The current
behavior, where M-x shell reuses the *shell* buffer, seems fine.




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#1975; Package emacs. (Sat, 10 Apr 2010 20:07:02 GMT) Full text and rfc822 format available.

Message #11 received at 1975 <at> debbugs.gnu.org (full text, mbox):

From: Jose E. Marchesi <jemarch <at> gnu.org>
To: cyd <at> stupidchicken.com
Cc: 1975 <at> debbugs.gnu.org
Subject: Re: Reusing dead shell buffers
Date: Sat, 10 Apr 2010 22:05:03 +0200 (CEST)
    > Just a tiny patch for shell.
    >
    > The patch assumes that the person launching M-xshell while in a
    > shell-mode buffer with a terminated process really wants to launch a
    > shell process in the current buffer instead to switch to "*shell*".
    >
    > The semantics of C-uM-xshell are not changed by the patch.
    
    Could you explain why you think this is necessary?  The current
    behavior, where M-x shell reuses the *shell* buffer, seems fine.

Just consider the situation where you use different shells
simultaneously with meaningful names.  For example, debugging an
application: shell-daemon, shell-mmi and shell-gdb.

If I want to restart the shell that is running in shell-gdb, I usually
Ctrl-D to terminate it and then I reuse the buffer.  Without the patch
I have to C-uM-xshell and then type shell-gdb.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#1975; Package emacs. (Wed, 11 Apr 2012 12:37:02 GMT) Full text and rfc822 format available.

Message #14 received at 1975 <at> debbugs.gnu.org (full text, mbox):

From: Lars Magne Ingebrigtsen <larsi <at> gnus.org>
To: Jose E. Marchesi <jemarch <at> gnu.org>
Cc: 1975 <at> debbugs.gnu.org, cyd <at> stupidchicken.com
Subject: Re: bug#1975: Reusing dead shell buffers
Date: Wed, 11 Apr 2012 14:34:44 +0200
Jose E. Marchesi <jemarch <at> gnu.org> writes:

> If I want to restart the shell that is running in shell-gdb, I usually
> Ctrl-D to terminate it and then I reuse the buffer.  Without the patch
> I have to C-uM-xshell and then type shell-gdb.

Currently `C-u M-x shell' defaults to "*shell*", which seems pretty
nonsensical.  Surely if the user wanted to use that buffer, then she
would have just typed `M-x shell'.

So perhaps `C-u M-x shell' should just default to the current buffer
instead?

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/




Reply sent to Chong Yidong <cyd <at> gnu.org>:
You have taken responsibility. (Fri, 30 Nov 2012 08:09:02 GMT) Full text and rfc822 format available.

Notification sent to jemarch <at> gnu.org:
bug acknowledged by developer. (Fri, 30 Nov 2012 08:09:02 GMT) Full text and rfc822 format available.

Message #19 received at 1975-done <at> debbugs.gnu.org (full text, mbox):

From: Chong Yidong <cyd <at> gnu.org>
To: Lars Magne Ingebrigtsen <larsi <at> gnus.org>
Cc: 1975-done <at> debbugs.gnu.org, "Jose E. Marchesi" <jemarch <at> gnu.org>
Subject: Re: bug#1975: Reusing dead shell buffers
Date: Fri, 30 Nov 2012 16:06:33 +0800
Lars Magne Ingebrigtsen <larsi <at> gnus.org> writes:

> Currently `C-u M-x shell' defaults to "*shell*", which seems pretty
> nonsensical.  Surely if the user wanted to use that buffer, then she
> would have just typed `M-x shell'.
>
> So perhaps `C-u M-x shell' should just default to the current buffer
> instead?

Agreed.  Implemented in trunk.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 28 Dec 2012 12:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 12 years and 150 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.