Wrapper script is causing problems on macOS
[!NOTE] We found out this issue to be related with the wrapper script that's giving admin privileges to the executable on macOS (needed to inspect a network adapter). This is causing several problems, such as the impossibility to close the app from the dock menu, minimize, and maximize the window.
To Reproduce Describe steps to reproduce the bug, e.g.:
- Open sniffnet
- Try to exit the app from Doc bar or force exit
Expected behavior To close app and it's all instances
Screenshots
Desktop:
- OS: MacOS
Thanks for pointing out, I never noticed it.
However, you should be able to comfortably close the app with cmd+Q.
After thinking about it I've found a reason for this issue and #198: on macOS the app is launched by a wrapper that gives it admin privileges required to inspect your PC's network adapters (see this file). After having launched the app, the wrapper is quit to not have more than one process running for Sniffnet. The app shown in the dock remains linked to the original process though (the wrapper which has already been quit). I'll work to fix this problem.
This is interesting, thanks @GyulyVGC
You're welcome!
For the same reason, I've discovered that Sniffnet 1.2.0 cannot be set full screen on macOS.
It's probably due to running the app in the background:
🡻
do shell script "/Applications/Sniffnet.app/Contents/MacOS/sniffnet >/dev/null 2>&1 &" with administrator privileges
May you please modify your /Applications/Sniffnet.app/Contents/MacOS/wrapper.sh file and test it without the >/dev/null 2>&1 & part?
P.S. We have to discuss our options for getting rid of the Terminal as well as launching the app using the native Window Manager. I might have some ideas... @GyulyVGC
The >/dev/null 2>&1 & is exactly the cause, but without including it the app starts in two separated instances and two open Sniffnet icons are shown (one for the script and one for the actual process).
The
>/dev/null 2>&1 &is exactly the cause, but without including it the app starts in two separated instances and two open Sniffnet icons are shown (one for the script and one for the actual process).
It's probably because the app launches itself after being launched by the wrapper script, yet sending one to the background is just sweeping the dirt under the carpet... Using sudo alone should be sufficient, but I'll discuss this further with you via email, we might be able to resolve this another way.
I just tried it without >/dev/null 2>&1 & and the issues are still there, unexpectedly.
The behaviour is the same except for the fact that two icons open instead of one.
Using sudo is what I did until the last release, but I didn't like that solution because a terminal was spawned and kept opened.