Skip to content

Fix panic when use header border without pointer/marker #4345

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

Merged
merged 1 commit into from
Apr 13, 2025

Conversation

phanen
Copy link
Contributor

@phanen phanen commented Apr 13, 2025

FZF_DEFAULT_OPTS= FZF_DEFAULT_OPTS_FILE= fzf --header-border --pointer= --header-lines 1
panic: strings: negative Repeat count

goroutine 58 [running]:
strings.Repeat({0x5c5f0633ad10?, 0x5c5f0633ad10?}, 0x1?)
	strings/strings.go:624 +0x585
github.com/junegunn/fzf/src.(*Terminal).printHeaderImpl(0xc000190008, {0x5c5f063a3978, 0xc00032c280?}, 0x4, {0x5c5f0656f960, 0x0, 0x5c5f062cde68?}, {0xc000114010, 0x1, 0x1})
	github.com/junegunn/fzf/src/terminal.go:2655 +0x1c6
github.com/junegunn/fzf/src.(*Terminal).printHeader.func1(...)
	github.com/junegunn/fzf/src/terminal.go:2610
github.com/junegunn/fzf/src.(*Terminal).withWindow(...)
	github.com/junegunn/fzf/src/terminal.go:1269
github.com/junegunn/fzf/src.(*Terminal).printHeader(0xc000190008)
	github.com/junegunn/fzf/src/terminal.go:2605 +0xe6
github.com/junegunn/fzf/src.(*Terminal).Loop.func8.2(0xc000010810)
	github.com/junegunn/fzf/src/terminal.go:4656 +0x565
github.com/junegunn/fzf/src/util.(*EventBox).Wait(0xc000010810, 0xc0002c7fa0)
	github.com/junegunn/fzf/src/util/eventbox.go:34 +0x5d
github.com/junegunn/fzf/src.(*Terminal).Loop.func8()
	github.com/junegunn/fzf/src/terminal.go:4581 +0xd7
created by github.com/junegunn/fzf/src.(*Terminal).Loop in goroutine 51
	github.com/junegunn/fzf/src/terminal.go:4559 +0x5fc

@junegunn junegunn merged commit 66df240 into junegunn:master Apr 13, 2025
5 checks passed
@junegunn
Copy link
Owner

Nice catch, thanks!

@junegunn junegunn added the bug label Apr 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants