firecat53 / networkmanager-dmenu

Control NetworkManager via dmenu
MIT License
783 stars 74 forks source link

Provide empty input to passphrase dmenu command #107

Closed electrickite closed 2 years ago

electrickite commented 2 years ago

I noticed that the passphrase input had stopped working while using bemenu. The issue occurs when dmenu_cmd is run to prompt for the passphrase - nothing is provided on the subprocess stdin. Bemenu will hang indefinitely waiting for input.

This patch simply sends an empty string on stdin to the dmenu command during the passphrase prompt.

firecat53 commented 2 years ago

I'm not seeing this issue. Tested on Fedora 36 with both i3 and sway with the appropriate bemenu backends (no xwayland on sway). I also have been using bemenu on sway and i3 for my other dmenu projects (keepmenu, bitwarden-menu) without issue (including adding/editing entries).

electrickite commented 2 years ago

Linux distro: Arch Linux Window Manager: sway bemenu version: v0.6.7

bemenu backend: Wayland

$ env | grep BEMENU
BEMENU_BACKEND=wayland

networkmanager_dmenu version: Commit 105507f

$ pacman -Q networkmanager-dmenu-git
networkmanager-dmenu-git r159.105507f-1

I think the basic problem is described in this bemenu issue: https://github.com/Cloudef/bemenu/issues/184
The recommendation there is to set stdin to /dev/null. I will test with this approach and update the PR.

electrickite commented 2 years ago

Setting the subprocess stdin to /dev/null works as well and aligns with the bemenu maintainer's advice. PR has been updated to use this approach.

firecat53 commented 2 years ago

Well, I have no idea why it doesn't work for you and it does for me! But since the PR doesn't seem to affect anything on this end, I'll merge it. Hopefully it doesn't break for others...

electrickite commented 2 years ago

Thanks for the merge! It is odd we're seeing different behavior, but I can reproduce the issue reliably on Arch/sway without this patch. And thanks also for your other projects - I've recently started using bitwarden-menu and it's very nice!