commit 4997d36

Hubert Hirtz  ·  2020-08-20 12:17:18 +0000 UTC
parent 1349e4b
ui: Show an error if on-highlight fails
1 files changed,  +5, -1
M app.go
M app.go
+5, -1
 1@@ -282,7 +282,11 @@ func (app *App) notifyHighlight(buffer, nick, content string) {
 2 		"%n", nick,
 3 		"%m", cleanMessage(content))
 4 	command := r.Replace(app.cfg.OnHighlight)
 5-	exec.Command(sh, "-c", command).Run()
 6+	err = exec.Command(sh, "-c", command).Run()
 7+	if err != nil {
 8+		line := fmt.Sprintf("Failed to invoke on-highlight command: %v", err)
 9+		app.win.AddLine(ui.Home, ui.NewLineNow("ERROR --", line))
10+	}
11 }
12 
13 func (app *App) requestHistory() {