atom-live-server-plus
atom-live-server-plus copied to clipboard
[enhancement] 'nuke all ports' macro or 'overide port' config option
If you have a problem launching a live-server, please try the following steps:
- Make sure you use the right hotkeys. After v2.0.0, the keys became
ctrl-altcombination. ✅ - Try launching live-server from the top menu:
Package -> live-server -> Start Serverto see if it works. ✅
hi! I'm having a problem with your package, when closing the atom instance, the processes don't stop, and next time I open it they're taking still ports. over time, this adds up so that all of the nice-looking ports are taken up and if I want to close every port I have to ctrl+alt+q tens of times in a row. This would work if there weren't hundreds of ports to close. I paused the package and the ports were still used, I reinstalled the package and the problem persists. this problem is very bad for projects that work with localStorage because it's a new 'site' every time.
I suggest, a 'nuke all ports' macro that will close every single port open, or maybe an option in the config to overwrite active ports, e.g. if I open port 3000 and then I open it again with the config enabled it will overwrite the previous process.
Would it be beneficial to close all ports when Atom quits? That should be the behavior, but looks like there's a bug I need to fix.
Hmm... looks like stopServer(), and by extension, kill(), should be called in the Atom deactivate() hook. Could you explain how you reproduce this issue? Looks like it might have to do with multiple Atom windows (and therefore, multiple instances of the extension?). Something like:
- Open one project in Atom window A
- Start Live Server
- Open new window and different project, window B
- Start Live Server in Window B
- Go back to window A, close without stopping Live Server
- Switch to window B, close and quit Atom
- Reopen Atom and start Live Server (Live Server from Window A was never suspended, since Atom did not quit), and it opens on a new port because the port from Window A is still in use.
Is that your situation? Or is it much simpler?
It's much harder to do a "nuke all ports" or "override ports" macro than to exit cleanly and gracefully beause in a new instance of the extension, I no longer have a reference to the Live Server processes from past instances, and you can't locate and kill a process by its port.
I haven't used Atom in years, and Atom is not even available on the system I use currently (M1 Mac), so your help with this issue will be greatly appreciated.