charmbracelet/crush · critical

Crush crashed. If metrics are enabled, we were notified abou

Error message

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

What it means

This error is created in internal/cmd/root.go when the Bubble Tea program.Run() call returns an error from the interactive TUI. It replaces the underlying error with a user-facing crash message pointing to the GitHub issue tracker; the actual stacktrace is logged above via slog and reported through the event/metrics system. It is a terminal-failure wrapper, not a recoverable condition.

Source

Thrown at internal/cmd/root.go:146

		event.AppInitialized()

		com := common.DefaultCommon(ws)
		model := ui.New(com, sessionID, continueLast)

		inputFilter := ui.NewFilter()
		var env uv.Environ = os.Environ()
		program := tea.NewProgram(
			model,
			tea.WithEnvironment(env),
			tea.WithContext(cmd.Context()),
			tea.WithFilter(inputFilter.Filter),
		)
		go ws.Subscribe(program)

		if _, err := program.Run(); err != nil {
			event.Error(err)
			slog.Error("TUI run error", "error", err)
			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") //nolint:staticcheck
		}
		var banner config.ExitBanner
		if cfg := com.Config(); cfg != nil {
			banner = cfg.Options.TUI.ExitBanner
		}
		printSessionResume(model, banner)
		return nil
	},
}

var heartbit = lipgloss.NewStyle().Foreground(charmtone.Dolly).SetString(`
    ▄▄▄▄▄▄▄▄    ▄▄▄▄▄▄▄▄
  ███████████  ███████████
████████████████████████████
████████████████████████████
██████████▀██████▀██████████
██████████ ██████ ██████████
▀▀██████▄████▄▄████▄██████▀▀

View on GitHub (pinned to 7944b8e522)

Solutions

  1. Copy the stacktrace printed above the message and open an issue at https://github.com/charmbracelet/crush/issues/new?template=bug.yml.
  2. Update crush to the latest version — the crash may already be fixed.
  3. As a workaround, run crush in non-interactive mode (crush run ...) to avoid the TUI code path entirely.
  4. Try a different terminal emulator or disable exotic terminal features (truecolor, images) via env vars.
Defensive patterns

Strategy: try-catch

Try / catch

if _, err := program.Run(); err != nil {
    event.Error(err)
    slog.Error("TUI run error", "error", err)
    return crashReportError // includes stacktrace + issue URL, as root.go does
}

Prevention

When it happens

Trigger: Any panic or error propagated out of program.Run() in the TUI — rendering bugs, unrecovered panics in UI components, terminal I/O failures during the Bubble Tea event loop.

Common situations: Rendering a message containing characters/widths that break layout math, a nil pointer in a UI component on unusual terminal sizes, or running the TUI in a terminal that does not support required capabilities.

Related errors


AI-assisted analysis of charmbracelet/crush@7944b8e522 (2026-08-29). Data as JSON: /api/errors/de31a6051fc74aa4. Report an issue: GitHub.