refactor: improve log and error messages (#2708)

This commit is contained in:
CatsDeservePets authored and GitHub committed 2026-10-12 21:33:05 +02:00
1 parent 5d3c7b7025
commit 664d7c88e1
10 files changed
+55 -52

No files matched your search

+5 -2
View File
@@ -54,9 +54,11 @@ func newApp(ui *ui, nav *nav) *app {
signal.Notify(sigChan, os.Interrupt, syscall.SIGHUP, syscall.SIGQUIT, syscall.SIGTERM)
go func() {
for {
switch <-sigChan {
sig := <-sigChan
switch sig {
case os.Interrupt:
case syscall.SIGHUP, syscall.SIGQUIT, syscall.SIGTERM:
log.Printf("received termination signal: %s", sig)
app.quit()
app.ui.screen.Fini()
os.Exit(3)
@@ -537,10 +539,11 @@ func (app *app) runCmdSync(cmd *exec.Cmd, pauseAfter bool) {
app.nav.previewChan <- ""
if err := app.ui.suspend(); err != nil {
log.Printf("suspend: %s", err)
log.Printf("suspending screen: %s", err)
}
defer func() {
if err := app.ui.resume(); err != nil {
log.Printf("resuming screen: %s", err)
app.quit()
os.Exit(3)
}