air icon indicating copy to clipboard operation
air copied to clipboard

Process not killed when closing terminal window/tab/session

Open bobmoff opened this issue 3 years ago • 3 comments

I am using iTerm on Mac and when closing the view/window that is running Air, the process is still running when I look at "Activity monitor".

Very easy reproduced. Just init a project with following code:

package main

import (
	"fmt"
	"time"
)

func main() {
	// print hello world with an 1 second interval, for ever
	for {
		fmt.Println("Hello World")
		time.Sleep(time.Second)
	}
}

bobmoff avatar Jan 19 '23 11:01 bobmoff

I have come across this problem as well about a week ago and ran your code above, it's hard to reproduce because its closing properly for me but i do remember this problem, can you re verify and what shell are you using?

AJ-Brown-InTech avatar Jan 25 '23 19:01 AJ-Brown-InTech

It happens for me every time I try.

i am using zsh on macOS.

bobmoff avatar Jan 25 '23 20:01 bobmoff

~~Same issue here but it's difficult to reproduce.~~

~~I think it has something to do with the fact that terminals typically send SIGHUP instead of SIGTERM when killing the panes and go run isn't propagating the SIGHUP to air.~~

~~Are you running the installed version of air or the go run github.com/cosmtrek/air, @bobmoff?~~

turns out it was my make command executing air that wasn't handling SIGHUP.

alankritjoshi avatar Dec 20 '23 17:12 alankritjoshi