I was having exactly the problem GP described a few years ago, and this was the fix.
It just about drove me nuts. It got to the point where I replaced my AP, started dragging a 10 meter ethernet cable around my house for my laptop, and started to suspect esoteric things like the local airport weather radar triggering DFS[^1].
In the end, it just turned out to be the damn Location Services.
If this is the case I could kiss all of you. I will try tonight!
I even went down the path of buying new powerline adapters only to have the same problem. I was unplugging things in the house and factory resetting everything. I've felt like I was going to crazy lengths to troubleshoot.
As a temporary measure, am I able to simply switch off the WiFi on those Mac devices before running those commands, to test?
You should only need to turn it off on the devices you're running the tests on.
I should have conditioned my previous comment with "if this is happening on an Apple device". In case it helps, I described what's happening under-the-hood in another comment: https://news.ycombinator.com/item?id=33451879
That is an amazing rabbit hole and the linked fix for TeXstudio is awesome.
It's surprising to me how so many programs seem to check location on an interval timer, including programs that seem at a glance to have no reason to need to know the user's location. I wonder if there's some common SDK library that makes it easy to accidentally enable.
So should I assume this didn't get fixed in Ventura? I have a new MacBook and have been wondering if I should turn off location services or if Apple fixed this.
Location Services works by asking Apple if it knows the location of any of WiFi access points near you.† Apple knows these locations by using services like Skyhook who wardrive around mapping locations of BSSIDs (AP mac addresses).
So, when Location Services is on (which it is by default), macOS will periodically switch your wireless card to monitor mode to find those nearby WiFi access points. Doing so stops normal network traffic for around a few 100 ms on the device.
† On devices with a GPS (i.e. iPhones and iPads) it will also sometimes use the GPS, but does so sparingly because the GPS uses much more power.
Nit: Apple hasn't used Skyhook or Google for positioning in over a decade [1].
> Apple ditched both Skyhook and Google location services and began relying on its own databases starting with the release of iOS 3.2 for the first-generation iPad in April of 2010