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

Setting GUM_CHOOSE_HEIGHT=0 causes integer divide by zero error #857

Open
RaulWCosta opened this issue Feb 13, 2025 · 0 comments
Open

Setting GUM_CHOOSE_HEIGHT=0 causes integer divide by zero error #857

RaulWCosta opened this issue Feb 13, 2025 · 0 comments

Comments

@RaulWCosta
Copy link

RaulWCosta commented Feb 13, 2025

Describe the bug

Running gum choose op1 op2, with GUM_CHOOSE_HEIGHT=0 causes integer divide by zero error

panic: runtime error: integer divide by zero

goroutine 1 [running]:
github.com/charmbracelet/gum/choose.Options.Run({{0xc0000fea60, 0x2, 0x2}, 0x1, 0x0, 0x0, 0x0, {0xc0006660a0, 0x2}, 0x1, ...})
        /home/runner/go/pkg/mod/github.com/charmbracelet/[email protected]/choose/command.go:109 +0x147f
reflect.Value.call({0x9e3e60?, 0xc00063e810?, 0xc000701490?}, {0x9f299b, 0x4}, {0xc0002916b0, 0x0, 0xc000291608?})
        /opt/hostedtoolcache/go/1.23.5/x64/src/reflect/value.go:581 +0xca6
reflect.Value.Call({0x9e3e60?, 0xc00063e810?, 0x1b?}, {0xc0002916b0?, 0x46949d?, 0x0?})
        /opt/hostedtoolcache/go/1.23.5/x64/src/reflect/value.go:365 +0xb9
github.com/alecthomas/kong.callAnyFunction({0x9e3e60?, 0xc00063e810?, 0x98c6a0?}, 0xc00074e420)
        /home/runner/go/pkg/mod/github.com/alecthomas/[email protected]/callbacks.go:139 +0x690
github.com/alecthomas/kong.callFunction({0x9e3e60?, 0xc00063e810?, 0xc000291ae0?}, 0xc00074e420)
        /home/runner/go/pkg/mod/github.com/alecthomas/[email protected]/callbacks.go:106 +0x17b
github.com/alecthomas/kong.(*Context).RunNode(0xc00052a080, 0xc00047bc20, {0x0, 0x0, 0x58e975?})
        /home/runner/go/pkg/mod/github.com/alecthomas/[email protected]/context.go:807 +0x849
github.com/alecthomas/kong.(*Context).Run(0xc00052a080, {0x0?, 0xc0004eded8?, 0xd?})
        /home/runner/go/pkg/mod/github.com/alecthomas/[email protected]/context.go:836 +0x13d
main.main()

To Reproduce
Steps to reproduce the behavior:

  1. export GUM_CHOOSE_HEIGHT=0
  2. gum choose op1 op2

Expected behavior

Command would execute successfully

Desktop (please complete the following information):

  • OS: 6.10.14-linuxkit
  • gum version v0.15.2

More context
This error did not happen on an older version (0.14.5)

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