Skip to content

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

@benjaminbojko

Description

@benjaminbojko

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions