Tomb icon indicating copy to clipboard operation
Tomb copied to clipboard

tomb slam does not force close all tombs

Open mandeep opened this issue 10 months ago • 3 comments

In testing mausoleum (gui), I found that tomb slam no longer works as expected. tomb close all works just fine however. I think in the past tomb slam closed all opened tombs and now it seems to require the name of the tomb to close.

This is occurring in a Docker container running ubuntu-latest.

root@9bc831224ac9:/app# tomb list
tomb  .  [test] open on /media/test using (rw,nodev,noatime)
tomb  .  [test] open since Wed May 28 22:30:52 2025
tomb  .  [test] open by root from /dev/pts/1 on 9bc831224ac9
tomb  .  [test] size 3.5M of which 40K (2%) is used: 2.9M free
tomb  .  [test3] open on /media/test3 using (rw,nodev,noatime)
tomb  .  [test3] open since Wed May 28 22:31:03 2025
tomb  .  [test3] open by root from /dev/pts/1 on 9bc831224ac9
tomb  .  [test3] size 3.5M of which 40K (2%) is used: 2.9M free
root@9bc831224ac9:/app# tomb slam
tomb [W] Too many tombs mounted, please specify one (see tomb list)
tomb [W] or issue the command 'tomb close all' to close them all.
tomb [E] Operation aborted.
root@9bc831224ac9:/app# tomb close all
tomb  .  Closing tomb [test] mounted on /media/test
tomb (*) Tomb [test] closed: your bones will rest in peace.
tomb  .  Closing tomb [test3] mounted on /media/test3
tomb (*) Tomb [test3] closed: your bones will rest in peace.
root@9bc831224ac9:/app# tomb list
tomb [E] I can't see any open tomb, may they all rest in peace.
root@9bc831224ac9:/app#

I think it would be beneficial to have a tomb slam all command.

mandeep avatar May 28 '25 22:05 mandeep

Hmm.. unintentional/overlooked behaviour change when slam and close were moved into one function. Therefore tomb slam all should work already. It shares the same syntax now.

Guess that leaves 3 options

  1. restore the old behaviour of slam of implicit all
    • simple check if SLAM and $1 is set. If it is empty replace with all
  2. keep it and slam and close have the same syntax
    • allows for fine grained slamming but needs the all
  3. change close to implicit all to keep them the same again but restore old behaviour
    • that change on close will be more impactful of a change

I tend to either 1 or 2. Leaning to 1 to restore the old behaviour.

Narrat avatar May 29 '25 15:05 Narrat

Either is fine with me. I think you could make the case that option 2 makes the most sense as it is consistent with close.

mandeep avatar May 30 '25 04:05 mandeep

Luckily the PR only adds the case when slam is called without an argument. So in general it stays compatible with close :)

Narrat avatar May 31 '25 17:05 Narrat