on main help sign in
chore: print a bug reporting notice when crush crashes

All the credit in this revision goes to @andreynering.

commit75a602ae3bdb8d3d22cb95f294f48348e0d4a267 authorChristian Rocha <christian@rocha.is> dateWed 1 Oct 2025, 13:42 (1 year ago) parentd0724b1
1 file changed+2−1
internal/cmd/root.go+2−1
internal/cmd/root.go+2−1
@@ -3,6 +3,7 @@ package cmd
33import (
44 "bytes"
55 "context"
6+ "errors"
67 "fmt"
78 "io"
89 "log/slog"
@@ -93,7 +94,7 @@ crush -y
9394 if _, err := program.Run(); err != nil {
9495 event.Error(err)
9596 slog.Error("TUI run error", "error", err)
96− return fmt.Errorf("TUI error: %v", err)
97+ return errors.New("Crush crashed. If metrics are enabled, we were notified about it. If you'd like to report it, please copy the stacktrace above and open an issue at https://github.com/charmbracelet/crush/issues/new?template=bug.yml")
9798 }
9899 return nil
99100 },