{"record":{"id":"de31a6051fc74aa4","repo":"charmbracelet/crush","slug":"crush-crashed-if-metrics-are-enabled-we-were-not","errorCode":null,"errorMessage":"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","messagePattern":"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","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"internal/cmd/root.go","lineNumber":146,"sourceCode":"\t\tevent.AppInitialized()\n\n\t\tcom := common.DefaultCommon(ws)\n\t\tmodel := ui.New(com, sessionID, continueLast)\n\n\t\tinputFilter := ui.NewFilter()\n\t\tvar env uv.Environ = os.Environ()\n\t\tprogram := tea.NewProgram(\n\t\t\tmodel,\n\t\t\ttea.WithEnvironment(env),\n\t\t\ttea.WithContext(cmd.Context()),\n\t\t\ttea.WithFilter(inputFilter.Filter),\n\t\t)\n\t\tgo ws.Subscribe(program)\n\n\t\tif _, err := program.Run(); err != nil {\n\t\t\tevent.Error(err)\n\t\t\tslog.Error(\"TUI run error\", \"error\", err)\n\t\t\treturn 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\n\t\t}\n\t\tvar banner config.ExitBanner\n\t\tif cfg := com.Config(); cfg != nil {\n\t\t\tbanner = cfg.Options.TUI.ExitBanner\n\t\t}\n\t\tprintSessionResume(model, banner)\n\t\treturn nil\n\t},\n}\n\nvar heartbit = lipgloss.NewStyle().Foreground(charmtone.Dolly).SetString(`\n    ▄▄▄▄▄▄▄▄    ▄▄▄▄▄▄▄▄\n  ███████████  ███████████\n████████████████████████████\n████████████████████████████\n██████████▀██████▀██████████\n██████████ ██████ ██████████\n▀▀██████▄████▄▄████▄██████▀▀","sourceCodeStart":128,"sourceCodeEnd":164,"githubUrl":"https://github.com/charmbracelet/crush/blob/7944b8e52225d8805e31eacbf7ef24856b0dfb7a/internal/cmd/root.go#L128-L164","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Copy the stacktrace printed above the message and open an issue at https://github.com/charmbracelet/crush/issues/new?template=bug.yml.","Update crush to the latest version — the crash may already be fixed.","As a workaround, run crush in non-interactive mode (crush run ...) to avoid the TUI code path entirely.","Try a different terminal emulator or disable exotic terminal features (truecolor, images) via env vars."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if _, err := program.Run(); err != nil {\n    event.Error(err)\n    slog.Error(\"TUI run error\", \"error\", err)\n    return crashReportError // includes stacktrace + issue URL, as root.go does\n}","preventionTips":["Keep crush updated; verify crashes against the latest release before reporting.","Test TUI sessions in a standard terminal emulator with default capabilities.","When it occurs, always capture the printed stacktrace and attach it to the GitHub issue."],"tags":["go","tui","crash","bubbletea"],"backgroundTag":"tui-runtime-crash","analyzedSha":"7944b8e52225d8805e31eacbf7ef24856b0dfb7a","analyzedAt":"2026-08-29T12:48:59.079Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}