Skip to content

Conversation

@chrispine
Copy link

I'd like to debug in VS Code, but termbox fails to init in that environment for some reason. Since all we want is the size, how about if we fall back to a reasonable default (80x25) in that case?

Copy link
Contributor

@LawnGnome LawnGnome left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fair. I thought about whether we should try to look at the COLUMNS and LINES environment variables before defaulting to 80x25, but realistically they're not usually available, so let's not complicate matters.

Copy link
Member

@eseliger eseliger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder what the cause is, but seems like a fair fix

@chrispine chrispine merged commit 3a159bc into main Aug 27, 2020
@chrispine chrispine deleted the cp/do-not-crash-if-termbox-fails-to-init branch August 27, 2020 23:27
@mrnugget
Copy link
Contributor

How did you find out it's termbox? Yesterday, when running into the bar.Max == 0 bug, I thought to myself: "hey, instead of adding fmt.Println number 18, why not try to use a debugger for once?" But then when I booted up dlv nothing happened :(

@chrispine
Copy link
Author

chrispine commented Aug 28, 2020

The call stack made it pretty clear that it was failing on init. (This was in VS Code where it failed, and I had a call-stack up to that point.)

scjohns pushed a commit that referenced this pull request Apr 24, 2023
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.

5 participants