Process not killed when closing terminal window/tab/session
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)
}
}
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?
It happens for me every time I try.
i am using zsh on macOS.
~~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.