{"record":{"id":"faf68c95d4a4ad79","repo":"bcicen/ctop","slug":"panic-err","errorCode":null,"errorMessage":"panic(err)","messagePattern":"panic\\(err\\)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"main.go","lineNumber":94,"sourceCode":"// init ui\nif *invertFlag {\n\tInvertColorMap()\n}\nui.ColorMap = ColorMap // override default colormap\nif err := ui.Init(); err != nil {\n\tpanic(err)\n}\ntm.SetInputMode(tm.InputAlt)\n\ndefer Shutdown()","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/bcicen/ctop/blob/59f00dd6aaebf48f3bc501e174f75f815c2619f0/main.go#L76-L112","documentation":"Panics when ui.Init() fails during terminal-UI startup in main. tcell's Init returns an error when the program cannot open/put the terminal into raw mode — e.g. stdout is not a TTY, TERM is unset or unsupported, or the terminfo database is missing. The program cannot run without a terminal, so startup aborts immediately.","triggerScenarios":"Thrown at main.go:94 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Run the tool inside a real terminal (TTY); it cannot run with redirected/pipe stdout","Set a supported TERM value (e.g. xterm-256color) and ensure terminfo files are installed","Replace the panic with a friendly message via fmt.Fprintln(os.Stderr,...)+os.Exit(1)","Check terminal permissions/SSH PTY allocation if initialization still fails"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"59f00dd6aaebf48f3bc501e174f75f815c2619f0","analyzedAt":"2026-09-02T23:34:03.832Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T02:17:09.455Z"}