Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Elevate launchpad to daemon to allow for better Win 11 terminal termination handling #91

Open
benjaminbojko opened this issue Dec 12, 2022 · 0 comments
Labels
bug Something isn't working #core #monitor

Comments

@benjaminbojko
Copy link
Collaborator

benjaminbojko commented Dec 12, 2022

Running launchpad in a Windows 11 terminal (instead of directly via cmd.exe) and closing the host (or hitting CTRL+C if launching through a .bat file via explorer) doesn't emit any exit/sigint signals.

How to Reproduce

  • On Windows 11, set the default terminal application to Let Windows decide or Windows Terminal:
    image
  • Option A: Close terminal window without CTRL+C
    • Launch a new terminal window
    • Run launchpad via npx launchpad and close the terminal window
  • Option B: Run launchpad via .bat that runs in terminal
    • Create a .bat file that runs npx launchpad
    • With Windows Terminal set as the default terminal application, launch the bat file
    • Enter CTRL+C or close the window

Expected Behavior

App should receive exit or sigint events from process.

Observed Behavior

App silently exists

Side-Effects

  • Apps aren't closed on exit
  • When launchpad is relaunched, it will launch additional app instances (since PM2 isn't run as a daemon anymore as of Connect to pm2 in no-daemon-mode #90 )
  • Temp files and downloads could be corrupted

Possible Solutions

  • Run launchpad as a daemon (e.g. via nodemon): npx launchpad -> spawns daemon -> launchpad.startup() -> contents of current index.js`
  • Spawn launchpad as a child process, just like PM2 is launching its own apps (needs testing).
  • Temp workaround: Don't use Windows Terminal as the default terminal app (not really sustainable)
@benjaminbojko benjaminbojko added bug Something isn't working #core #monitor labels Dec 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working #core #monitor
Projects
None yet
Development

No branches or pull requests

1 participant