INNER CODE UNIT · Go

waitForExit

eko/monday · cmd/main.go:214

func waitForExit(ctx context.Context, layout *ui.Layout) {
	exit := make(chan os.Signal, 1)

	if uiEnabled {
		// The terminal UI handles SIGINT and SIGTERM itself and restores the
		// terminal before returning: only a hangup (terminal closed) has to
		// be relayed so the shutdown still happens
		signal.Notify(exit, syscall.SIGHUP)

		go func() {
			<-exit
			layout.Quit()
		}()

		if err := layout.Run(); err != nil {
			fmt.Printf("❌  An error has occured while running the terminal UI: %v\n", err)
		}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…