{"record":{"id":"96a1c0e90ead9ae5","repo":"charmbracelet/gum","slug":"unable-to-start-program-w","errorCode":null,"errorMessage":"unable to start program: %w","messagePattern":"unable to start program: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pager/command.go","lineNumber":55,"sourceCode":"\t\tcontent:             o.Content,\n\t\torigContent:         o.Content,\n\t\tshowLineNumbers:     o.ShowLineNumbers,\n\t\tlineNumberStyle:     o.LineNumberStyle.ToLipgloss(),\n\t\tsoftWrap:            o.SoftWrap,\n\t\tmatchStyle:          o.MatchStyle.ToLipgloss(),\n\t\tmatchHighlightStyle: o.MatchHighlightStyle.ToLipgloss(),\n\t\tkeymap:              defaultKeymap(),\n\t}\n\n\tctx, cancel := timeout.Context(o.Timeout)\n\tdefer cancel()\n\n\t_, err := tea.NewProgram(\n\t\tm,\n\t\ttea.WithContext(ctx),\n\t).Run()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"unable to start program: %w\", err)\n\t}\n\n\treturn nil\n}\n","sourceCodeStart":37,"sourceCodeEnd":60,"githubUrl":"https://github.com/charmbracelet/gum/blob/4d089f95507708a71f64dacfe7ca513219dd5267/pager/command.go#L37-L60","documentation":"Gum pager wraps any error returned by tea.Program.Run() (the bubbletea TUI runtime) with this message. It means the pager's full-screen program failed to start or aborted mid-run — terminal incompatibility, I/O failure, or context cancellation propagated from the underlying renderer.","triggerScenarios":"Running `gum pager` in a non-TTY environment, a terminal that bubbletea cannot initialize (bad TERM, no /dev/tty), or the context passed via tea.WithContext(ctx) being cancelled before Run completes.","commonSituations":"CI jobs or cron jobs invoking gum pager without a TTY; SSH sessions with weird TERM settings; SIGINT/SIGTERM cancelling the parent context.","solutions":["Run the command inside a real interactive terminal (TTY); avoid it in CI scripts.","Check TERM is set to a capable value (e.g. export TERM=xterm-256color).","Inspect the wrapped error (%w) to see the underlying bubbletea failure.","If the context is being cancelled, verify parent goroutine/signal handling."],"exampleFix":"// before (in CI, no TTY)\ngit log | gum pager\n// after\nif [ -t 0 ] && [ -t 1 ]; then git log | gum pager; else git log | less; fi","handlingStrategy":"fallback","validationCode":"if [ -t 0 ] && [ -t 1 ]; then git log | gum pager; else git log | less; fi","typeGuard":null,"tryCatchPattern":"if ! out=$(git log | gum pager 2>&1); then echo \"pager failed: $out\"; git log | less; fi","preventionTips":["Only run gum pager in interactive TTY sessions","Set a sane TERM variable","Provide a non-TUI fallback (less/more) for scripts and CI"],"tags":["tui","bubbletea","terminal","tty"],"backgroundTag":"program-start-failed","analyzedSha":"4d089f95507708a71f64dacfe7ca513219dd5267","analyzedAt":"2026-08-31T18:45:06.436Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}