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

gum input header flags can output an incorrect render #582

Closed
ndsizeif opened this issue May 16, 2024 · 4 comments
Closed

gum input header flags can output an incorrect render #582

ndsizeif opened this issue May 16, 2024 · 4 comments
Assignees
Labels
bug Something isn't working cmd/input
Milestone

Comments

@ndsizeif
Copy link

ndsizeif commented May 16, 2024

Describe the bug
Setting some of the header properties of gum input including, --header.align and --header.height, can cause rendering over subsequent lines of the output.

To Reproduce
This simple bash script sets a header and aligns it inside a border.

#!/bin/bash

term_width=$(tput cols)
WIDTH=$((term_width / 2))

gum input \
	--header="example header" \
	--header.width=$WIDTH \
	--header.align="center" \
	--header.border="thick"

border14 0

Using a border makes the behavior apparent, but output is also affected without a border. Setting header height to more than 2 obscures the placeholder.

gum input \
	--header="example header" \
	--header.height="4"

height14 0

Expected behavior
The above commands should render as they do using gum v0.13.0

border13 0

height13 0

gum version 0.14.0 (295a671)

Description:    Manjaro Linux
Release:        24.0.0
Codename:       Wynsdey
@aymanbagabas aymanbagabas added the bug Something isn't working label Jul 23, 2024
@caarlos0
Copy link
Member

this should be fixed by #634

@caarlos0 caarlos0 self-assigned this Jul 24, 2024
@caarlos0 caarlos0 added this to the v0.14.2 milestone Jul 24, 2024
@ndsizeif
Copy link
Author

Thanks for working on this @caarlos0.

I just wanted to report behavior of some scripts using commit 96448e0

The scripts without any type of border now work as expected. Thanks for the fix.

gum input \
	--header="example header"

The scripts with a border will have the input line obscured

gum input \
	--header="example header"
	--header.border="thick"

gum v0.13.0
gum13
96448e0
gum14

@caarlos0
Copy link
Member

good find, seems to be related to the height, not sure how yet, though

caarlos0 added a commit to charmbracelet/huh that referenced this issue Aug 19, 2024
if height is not set, it will never actually work properly.

refs charmbracelet/gum#582

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
caarlos0 added a commit to charmbracelet/huh that referenced this issue Aug 19, 2024
if height is not set, it will never actually work properly.

refs charmbracelet/gum#582

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
caarlos0 added a commit to charmbracelet/huh that referenced this issue Aug 19, 2024
if height is not set, it will never actually work properly.

refs charmbracelet/gum#582

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
@caarlos0
Copy link
Member

should be fixed on main!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cmd/input
Projects
None yet
Development

No branches or pull requests

3 participants