mklement0 / ttab

macOS and Linux CLI for opening a new terminal tab/window, optionally with a command to execute and/or display settings
283 stars 16 forks source link

ttab SIGTERM #69

Open evanlemke opened 7 months ago

evanlemke commented 7 months ago

If i start project with ttab, closing the tab warns me that the application will terminate but it doesn't. It remains running and holds on to the port, preventing me from restarting the application

ttab 'npm run dev'

If i start the application with out ttab, closing the tab warns me that the application will terminate and it actually does.

npm run dev

Can you provide any guidance for ensuring that my sub-command does exit?

evanlemke commented 7 months ago

I found a work-around. By adding & to the end of my command, closing the tab will properly terminate the application.

I wish I could explain why that works, typically & would make the task run in the background but in this case my dev server runs in the foreground like normal but allows it to properly receive the SIGHUP on terminal exit

 ttab 'npm run dev &'