gobble
gobble copied to clipboard
Crash when trying to gobble terminal that isn't focused
Describe the bug If the terminal isn't focused when the new window is opened, gobble crashes leaving the command running in a weird state where the terminal/stdin is shared between the called shell/program and the gobbled command.
To Reproduce Steps to reproduce the behavior: Having mpv installed, run the following expression in a shell. While sleeping, minimize/unfocus all windows.
sleep 5; gobble mpv --force-window --idle
Expected behavior
gobble
doesn't unmap/hide any windows nor does it exit to the shell/calling command. mpv
runs as if it was called directly.
Additional context Version 1.3 from nixpkgs
Reproduced (with Konsole, on X11, GNOME, Manjaro = stable Arch x64 Linux, current main (68cb9c562b69ffd8152cd409ec1afd68253399f4) installed with makepkg -si).
(UPDATE: I've moved the previous content about terminal-specific behaviour to #12.)
Hi @EmperorPenguin18, if this issue is confirmed, suggest re-using some code from https://github.com/Liupold/pidswallow. Its README.md > Features says: "Based on process hierarchy (don't care about window focus)".
(Plus, Liupold/pidswallow
is also Arch-friendly, AUR-distributed.)
Though, that requires the child window ID - can we get it in any way?
If that would slow gobble
too much, maybe there could be two executables (rather than an option, which makes it awkward). For example gobble
(current behaviour) and gobble-any-focus
?
FYI same problem with Devour (an older alternative, written in C, even less maintained, unfortunately): https://github.com/salman-abedin/devour/issues/39.
I can reproduce the issue and have pushed a change to main. Try it to see if that fixes the crash for you. I have a feeling this may be window manager dependent, because I had to jump through some hoops to be able to manually iconify a window.