Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draw panics with index out of range error in MacOS Terminal app. #17

Open
jhr22 opened this issue Jun 19, 2023 · 0 comments
Open

Draw panics with index out of range error in MacOS Terminal app. #17

jhr22 opened this issue Jun 19, 2023 · 0 comments

Comments

@jhr22
Copy link

jhr22 commented Jun 19, 2023

Describe the bug
Draw panics with index out of range error in MacOS Terminal app.

This only happens for me when dragging off the screen to the right.

To Reproduce
Steps to reproduce the behavior:

  1. Open Terminal app on MacOS
  2. Left click in hold in the middle of the screen
  3. Drag to the right
  4. See panic

Expected behavior
Expected draw not to panic (do not allow index out of range)

Screenshots

Up, down, left okay, right not okay.

Screenshot 2023-06-19 at 13 53 40

Desktop (please complete the following information):

  • OS: MacOS
  • Application Terminal App
  • Version 13.4

Additional context

Caught panic:

runtime error: index out of range [90] with length 90

Restoring terminal...

goroutine 1 [running]:
runtime/debug.Stack()
	/opt/homebrew/Cellar/go/1.20.4/libexec/src/runtime/debug/stack.go:24 +0x64
runtime/debug.PrintStack()
	/opt/homebrew/Cellar/go/1.20.4/libexec/src/runtime/debug/stack.go:16 +0x1c
github.com/charmbracelet/bubbletea.(*Program).StartReturningModel.func3()
	/Users/jhr22/go/pkg/mod/github.com/charmbracelet/[email protected]/tea.go:359 +0x8c
panic({0x104f5d600, 0x1400001a0a8})
	/opt/homebrew/Cellar/go/1.20.4/libexec/src/runtime/panic.go:890 +0x258
main.(*model).Update(0x14000146080, {0x104f5cc60?, 0x140000a8620?})
	/Users/jhr22/go/pkg/mod/github.com/maaslalani/[email protected]/draw.go:65 +0xfe4
github.com/charmbracelet/bubbletea.(*Program).StartReturningModel(0x14000146100)
	/Users/jhr22/go/pkg/mod/github.com/charmbracelet/[email protected]/tea.go:547 +0xf70
github.com/charmbracelet/bubbletea.(*Program).Start(...)
	/Users/jhr22/go/pkg/mod/github.com/charmbracelet/[email protected]/tea.go:556
main.main()
	/Users/jhr22/go/pkg/mod/github.com/maaslalani/[email protected]/main.go:21 +0x64
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

No branches or pull requests

1 participant