1

Emacs 26.1

First I create several buffers in shell mode.

enter image description here

Then I open ibuffer (C-x C-b) and mark all shell buffers manually by pressing D to delete them.

It works, but it's very slow. Is there a quicker method for deleting all buffers in shell mode?

jagrg
  • 3,824
  • 4
  • 19
a_subscriber
  • 3,854
  • 1
  • 17
  • 47
  • 1
    A more general (but similar) question was asked [here](https://emacs.stackexchange.com/questions/59378/how-can-i-kill-buffers-based-on-mode) with a few answers. – jagrg Sep 22 '20 at 00:12

2 Answers2

3

A slightly quicker way that still uses IBuffer, is (from IBuffer) to use % m shell to mark all of the buffers in shell mode, and then press D to delete then all in one go. Depending on what other modes you've got open you might get away with using "sh" instead of shell. I use variations on this quite a lot to kill the many Ag and Dired buffers that I seem to typically end up with.

stevoooo
  • 737
  • 3
  • 8
2

You may want to look into the customizable var ibuffer-saved-filter-groups, to sort your buffers into groupings based on mode (or any other criteria). Then you can mark a group at once by marking its heading. Right now, they're all in one group [Default], but you could easily have [Shells], etc.

jeffkowalski
  • 486
  • 2
  • 5