{"record":{"id":"03de5a55634ed286","repo":"jesseduffield/lazygit","slug":"you-died","errorCode":null,"errorMessage":"YOU DIED!","messagePattern":"YOU DIED!","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"info","filePath":"pkg/gui/controllers/helpers/snake_helper.go","lineNumber":43,"sourceCode":"\n\tgame := snake.NewGame(view.InnerWidth(), view.InnerHeight(), self.renderSnakeGame, self.c.LogAction)\n\tself.game = game\n\tgame.Start()\n}\n\nfunc (self *SnakeHelper) ExitGame() {\n\tself.game.Exit()\n}\n\nfunc (self *SnakeHelper) SetDirection(direction snake.Direction) {\n\tself.game.SetDirection(direction)\n}\n\nfunc (self *SnakeHelper) renderSnakeGame(cells [][]snake.CellType, alive bool) {\n\tview := self.c.Views().Snake\n\n\tif !alive {\n\t\tself.c.OnUIThread(func() error { return errors.New(self.c.Tr.YouDied) })\n\t\treturn\n\t}\n\n\toutput := self.drawSnakeGame(cells)\n\n\tview.Clear()\n\tfmt.Fprint(view, output)\n\tself.c.Render()\n}\n\nfunc (self *SnakeHelper) drawSnakeGame(cells [][]snake.CellType) string {\n\twriter := &strings.Builder{}\n\n\tfor i, row := range cells {\n\t\tfor _, cell := range row {\n\t\t\tswitch cell {\n\t\t\tcase snake.None:\n\t\t\t\twriter.WriteString(\" \")","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/jesseduffield/lazygit/blob/c477a2959b229fbf3284be0d4d2904ab61ec3c94/pkg/gui/controllers/helpers/snake_helper.go#L25-L61","documentation":"Returned by SnakeHelper.renderSnakeGame via OnUIThread when the built-in snake game's render callback reports alive=false, i.e. the snake collided and the run ended. Tr.YouDied ('YOU DIED!') is displayed through lazygit's normal error-alert path — the game intentionally reuses the error channel as a UI notification, so this is not a defect but a deliberately theatrical game-over toast.","triggerScenarios":"Playing the hidden snake game (pressing the key sequence to open it, default '?e' era cheat) and steering the snake into a wall or its own body; also when a tick renders after a losing move.","commonSituations":"Only ever inside the easter-egg game; no git state is touched. Users seeing it outside the game would have a view-misrouting bug, which does not occur in practice.","solutions":["Acknowledge the alert and press the game's restart key (r) for a new run.","Exit the game (q/Esc) to return to the normal UI.","No git or repository action is needed."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"// nothing to catch: the error IS the game-over notification\nif err := <-gameErrCh; err != nil && err.Error() == c.Tr.YouDied {\n    // restart or exit the game\n}","preventionTips":["Treat Tr.YouDied as a notification, not a failure","Exit the game with q/Esc when done"],"tags":["easter-egg","game","ui-notification","non-error"],"backgroundTag":null,"analyzedSha":"c477a2959b229fbf3284be0d4d2904ab61ec3c94","analyzedAt":"2026-08-15T08:34:32.451Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}