mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-01-11 14:40:25 +01:00
[BUG]: Closed terminal leaving ghost tiles when multiple terminal windows open #536
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @gursuj on GitHub (Nov 28, 2024).
Summary
I know the bug report template says not to open issues for ghost tiles but in this case, ignoring the window causing the ghost tile is not a proper fix. Happens to me with windows terminal where, if I open multiple terminal windows and close one, the empty space isn't occupied by any other window. Running
komorebic visible-windowsshows that komorebi still thinks the closed window is still there. Example screenshot and output:Moving everything off the workspace will then create a transparent window with the window title of the closed window (shown below) which can then be closed.
Not sure if this is being caused by Windows Terminal as closing the terminal seems to kill its powershell process as well when viewing inside Task Manager.
Version Information
OS Name: Microsoft Windows 10 Home
OS Version: 10.0.19045 N/A Build 19045
komorebic 0.1.30
tag:v0.1.30
commit_hash:9a3dbccc
build_time:2024-11-03 23:49:52 +00:00
build_env:rustc 1.82.0 (f6e511eec 2024-10-15),stable-x86_64-pc-windows-msvc
Komorebi Configuration
Hotkey Configuration
Output of komorebic check
KOMOREBI_CONFIG_HOME detected: C:\Users\sujal.config\komorebi
Looking for configuration files in C:\Users\sujal.config\komorebi
Found komorebi.json; this file can be passed to the start command with the --config flag
Found C:\Users\sujal.config\whkdrc; key bindings will be loaded from here when whkd is started, and you can start it automatically using the --whkd flag
@gursuj commented on GitHub (Nov 28, 2024):
Issue has been reported by someone else in this discord thread, though with something other than windows terminal
@LGUG2Z commented on GitHub (Nov 28, 2024):
I'm not able to reproduce this with Windows Terminal 🤔 - I wonder if this is something specific to Windows 10
@alex-ds13 commented on GitHub (Nov 28, 2024):
This might be related to this issue on Windows terminal https://github.com/microsoft/terminal/issues/17298.
How exactly are you closing the window? To me after closing the window it takes a second but then the ghost tile and border disappears. This is because the workaround for the issue above is having a thread going on every second checking for this kind of windows and remove them. That's why it takes a few milliseconds to a second but it always removes them. There is even a line on the logs saying:
Can you check your logs to see if the line above ever shows after you close it?
@gursuj commented on GitHub (Nov 29, 2024):
Didn't find anything related to reaper in the logs. Komorebi doesn't seem to create the log file for me so I used the log command and got these logs when closing the terminal window.
This behavior was fixed for me a while back but again started happening randomly. Happens when using both the close button for the window as well as the whkd binding
@gursuj commented on GitHub (Nov 29, 2024):
If I have only one terminal open and close it, this happens and the empty space is reclaimed after a second. But if I have two terminals open and close one, its empty space creates a lingering ghost tile.
@alex-ds13 commented on GitHub (Nov 29, 2024):
The logs are kept on
%LOCALAPPDATA%/TEMPor simply%TEMP%. There will be some files with name starting with komorebi with the day which the log relates to. You want to see the files that haveplaintexton them. Search them for the termkomorebi::reaper.It seems to me that the reaper thread has stopped for some reason. @LGUG2Z there should be a
"reaped 1 orphan window"above on those logs after closing windows terminal, right?There should be some error in the logs saying what happened. The repear thread should restart itself even if there is an error, so it would be important to get those logs to understand exactly what might have happened.
@gursuj commented on GitHub (Nov 30, 2024):
Ah, thanks. I was looking for logs in the komorebi folder inside localappdata. These are the logs when closing only one of the two terminals (no reaper reaped log but there is an error):
These are the logs when opening 2 terminal windows, then closing both of them. Reaper does seem to trigger when I close both of the open terminals and then the space is reclaimed. Note: I have a floating nvim window open that I switch to at the end.
@gursuj commented on GitHub (Dec 1, 2024):
Also found another strange behavior with windows terminal. Steps to recreate:
This leaves a transparent window with the same titlebar as the closed terminal, like so:

This behavior seems kinda unpredictable as when I first encountered this, it didn't leave a transparent window but only a ghost tile that could be fixed by maximizing, then unmaximizing the non-terminal window. I started testing it and then the transparent window started appearing.
Logs recorded after opening a terminal, maximizing, closing it. At the end, I minimize the transparent window and switch to a floating nvim window
@cjpack123 commented on GitHub (Dec 26, 2024):
This is happening to me on windows 11. Or sorta similar, some windows when I try to close by clicking on the X will leave a ghost tile with a border (maybe it does for you but you have it turned off) Things I noticed:
Doesnt happen if I use alt Q to close the window.
Happens usually with windows that would usually get closed but stay running in the sys tray. Windows terminal, icloud windows, autohotkey are all ones I recall it happening to.
The window isn't actually closed and will display the contents within the border again if I cycle focus to it, only way I know how to do that.
The issue is alt q closes not only the window but also closes it from the sys I dont know how to close the window but leave it running in sys tray. I only know close entirely or minimize window.
@gursuj commented on GitHub (Dec 26, 2024):
Hmm what are you binding alt+q to? Or are you using the default shortcut where its set to
komorebic close? For me, the bug happens even when using this shortcut.Strange. I think this is a bug with the specific apps you use, rather than with komorebi. I tested this and qbittorrent properly exits to the system tray but laragon closes entirely when using the shortcut. If I use the close button, then laragon exits to the tray. Also, I don't think windows terminal is supposed to exit to the tray.
@ramppdev commented on GitHub (Jan 2, 2025):
Adding the following to the
komorebi.jsonseems to solve the issue:@gursuj commented on GitHub (Jan 3, 2025):
@ramppdev Thanks, that worked. @cjpack123 can you check if this works for you? If so, this issue may be closed
@ramppdev commented on GitHub (Jan 3, 2025):
@dinesh-58 sound good. Before closing you could open an issue in https://github.com/LGUG2Z/komorebi-application-specific-configuration such that it will work for everyone in future versions :)
@gursuj commented on GitHub (Jan 3, 2025):
Good idea. Thanks
@gursuj commented on GitHub (Jan 3, 2025):
Update: I tried adding laragon to
tray_and_multi_window_applicationsrules but seems it still has the issue of closing entirely instead of closing to the tray. So I guess that's an issue with laragon itself? So this fix might not work for the programs mentioned by cjpack.@ramppdev commented on GitHub (Jan 3, 2025):
I think the issue they are experiencing is unrelated to the windows terminal one, as the
tray_and_multi_window_applicationsshould fully close the application. We just want to remove the ghost tiles and not "minimize" / close to the system tray.@gursuj commented on GitHub (Jan 3, 2025):
Makes sense. I read the documentation for
tray_and_multi_window_applicationsand that also says this rule is meant for ghost tiles only. Guess I'll open a separate issue for this.@alex-ds13 commented on GitHub (Jan 7, 2025):
@dinesh-58 @ramppdev Is it possible that you are using a setting on Windows Terminal called "Hide Terminal in the notification area when it's minimized" or the "Always display an icon on the notification area" on the
Appearancetab of Windows Terminal settings?@gursuj commented on GitHub (Jan 7, 2025):
This issue has been fixed actually. I was just waiting on cjpack to reply. I'll close this
@cjpack123 commented on GitHub (Jan 11, 2025):
That worked thanks! Sorry didn’t see this.
On Tue, Jan 7, 2025 at 2:20 AM Sujal Gurung @.***>
wrote: