Skip to content

fix(chat): start without a screen for the tab status - #16

Merged
dartpain merged 1 commit into
mainfrom
fix/tab-status-startup
Oct 16, 2026
Merged

dartpain merged 1 commit into
mainfrom
fix/tab-status-startup

Conversation

@dartpain

Copy link
Copy Markdown
Contributor

What

v1.10.0 panics as soon as the chat starts:

panic: runtime error: invalid memory address or nil pointer dereference
ui.(*Screen).do(0x0, …)            internal/ui/screen.go:169
ui.(*Screen).TabStatus(...)        internal/ui/terminal.go:64
cmd.(*chatSession).tabStatus(...)  cmd/chat.go:290
cmd.(*chatSession).reset(...)      cmd/chat.go:561
cmd.runChat(...)                   cmd/chat.go:148

runChat calls reset() before it creates the screen, and reset() now clears the tab status through s.scr, which is still nil at that point. One-shot questions (docsgpt-cli "…") are unaffected.

Fix

tabStatus returns when there is no screen yet: nothing can be shown on the tab before then.

Testing

  • New TestResetBeforeScreen: panics without the fix, passes with it.
  • gofmt -l ., go vet ./..., go test ./...
  • Started the binary in a pseudo-terminal with a throwaway HOME: the v1.10.0 code panics, this branch brings up the chat screen.

runChat resets the session before it makes the screen, and the reset
cleared the tab status through the nil screen: every chat panicked on
start in v1.10.0.
@dartpain
dartpain merged commit f791fe7 into main Oct 16, 2026
1 check passed
@dartpain
dartpain deleted the fix/tab-status-startup branch October 16, 2026 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant