xdaemon icon indicating copy to clipboard operation
xdaemon copied to clipboard

windows下,执行ctrl+c 会把后台的子进程退出

Open mutu1213 opened this issue 3 years ago • 1 comments

代码如下非常简单 `func main() { xdaemon.Background(".log", true) r := gin.New() r.Handle("GET", "/test", test) r.Run(":3333") }

func test(ginCtx *gin.Context) { ginCtx.AbortWithStatus(400) }` 步骤 1 、在CMD中执行 test.exe后,显示 启动子进程成功: -> 1600 2、在CMD中键盘ctrl+c 3、pid为1600的子进程已退出

mutu1213 avatar Oct 26 '22 08:10 mutu1213

windows版本编译时加入如下参数就不会退出了: go build -ldflags="-H windowsgui"

sjwhi8989 avatar Dec 30 '22 09:12 sjwhi8989