Skip to content

Changing workspaces or changing focus causes zombie shells #307

@thexavier666

Description

@thexavier666

Version Information:

  • Distribution Information ( run uname -a )

Linux <HOSTNAME> 6.8.0-1020-oem #20-Ubuntu SMP PREEMPT_DYNAMIC Wed Jan 22 08:17:35 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux

  • swhkd version ( swhkd -V )

Simple-Wayland-HotKey-Daemon 1.3.0-dev

Describe the bug:

I am using sxhkd along with sway. So this is what a snippet of my config file looks

#------------------------------------------------------------------------------
# WINDOW CHANGE FOCUS
#------------------------------------------------------------------------------

alt + {h,j,k,l}
    swaymsg focus {left,down,up,right}

alt + {Left,Down,Up,Right}
    swaymsg focus {left,down,up,right}

#------------------------------------------------------------------------------
# CHANGE WORKSPACE
#------------------------------------------------------------------------------

alt + {1-9,0}
    swaymsg workspace {1-9,10}

My sway config does not contain any keybinds.

This is how swhkd is initiated inside my sway config

exec /usr/bin/swhks & disown
exec /usr/bin/swhkd -c ~/.config/swhkd/config & disown

Whenever I change focus or switch to a different workspace, swhkd spawns a new shell (which is fine) but the shell is not properly killed and it becomes a zombie.

$ pgrep sh -a | grep defunct | wc -l
176

I can see via tree view in htop that all the shells belong to parent process swhkd.
Killing the parent process removes all zombie processes. Restarting it does not solve it.

To Reproduce:

  1. Install sway and swhkd
  2. Put only the change focus and change workspace commands in swhkd config
  3. Monitor child process of swhkd in htop or top

Additional information:
I have recently moved from sxhkd and this problem does not occur there. I am assuming the error is present where the processes are spawned in swhkd.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions