doomemacs icon indicating copy to clipboard operation
doomemacs copied to clipboard

Killing a workspace can mess up another workspace's windows

Open Patryk27 opened this issue 11 months ago • 0 comments

I confirm that...

  • [x] I have searched the issue tracker, documentation, FAQ, Discourse, and Google, in case this issue has already been reported/resolved.

  • [x] I have read "How to Debug Issues", and will use it to provide as much information about this issue as possible.

  • [x] The issue can be reproduced on the latest available commit of Doom.

  • [x] The issue can be reproduced on a stable release of Emacs, such as 27, 28, 29, or 30. (Unstable versions end in .50, .60, or .9x)

Expected behavior

When I kill the current workspace ((+workspace/kill)), I expect to be brought to another (e.g. previous) alive workspace without its windows being touched - i.e. the behavior should be the same as if instead of killing the current workspace, I first jumped to another workspace and then killed that other workspace I was on.

Current behavior

When I kill the current workspace ((+workspace/kill)), I am brought to the previous workspace (✅), but sometimes a window that was present there is gone (❌).

I think this is the culprit:

https://github.com/doomemacs/doomemacs/blob/e614ffbda8b278bc9fd9a9cb3a836d636b1091e6/modules/ui/workspaces/autoload/workspaces.el#L278

... because (doom-buffer-frame-predicate) (or rather (doom-real-buffer-p)) evaluates to nil on temporary buffers (*new*<123>) - or at least dropping those two lines gets me "the correct" behavior.

Steps to reproduce

  • create a new buffer ((evil-buffer-new)),
  • create a new workspace and switch to it ((+workspace/new)),
  • kill the current workspace ((+workspace/kill)),
  • you get brought into the previous workspace (✅), but this temporary buffer you had is not visible anymore (❌).

System Information

https://pastebin.com/11aeFEaL

Patryk27 avatar May 13 '25 06:05 Patryk27