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 spin messes the screen #607

Open
vt-alt opened this issue Jun 16, 2024 · 4 comments · Fixed by #621 · May be fixed by #636
Open

gum spin messes the screen #607

vt-alt opened this issue Jun 16, 2024 · 4 comments · Fixed by #621 · May be fixed by #636
Labels
bug Something isn't working cmd/spin

Comments

@vt-alt
Copy link

vt-alt commented Jun 16, 2024

Describe the bug
gum started to mess the screen when showing output (regression).

To Reproduce
This is minified example:

$ gum spin --show-output -- seq 22 | less
1
 2
  3
   4
    5
     6
      7
       8
        9
         10
           11
             12
               13
                 14
                   15
                     16
                       17
                         18
                           19
                             20
                               21
                                 22

Actual use case is curling log files and piping it to less causing total screen mess after less exits while spinner was still active: gum spin --show-output -- curl -sSf -L https://git.altlinux.org/tasks/347163/build/100/x86_64/log | less

Expected behavior
0.12.0 worked better:

$ gum spin --show-output -- seq 22 | less
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

curl example worked good too.

Desktop (please complete the following information):

  • OS: ALT Linux
  • gum version 0.14.1
aymanbagabas added a commit to charmbracelet/bubbletea that referenced this issue Jul 16, 2024
We need to reset the cursor position to the beginning of the line when
the program stops or exit.

Related: charmbracelet/gum#607
aymanbagabas added a commit that referenced this issue Jul 16, 2024
We need to pause the main tea.Program process to restore the terminal
state before running the sub-process.

Fixes: #607
aymanbagabas added a commit to charmbracelet/bubbletea that referenced this issue Jul 16, 2024
We need to reset the cursor position to the beginning of the line when
the program stops or exit.

Related: charmbracelet/gum#607
aymanbagabas added a commit to charmbracelet/bubbletea that referenced this issue Jul 16, 2024
We need to reset the cursor position to the beginning of the line when
the program stops or exit.

Related: charmbracelet/gum#607
aymanbagabas added a commit to charmbracelet/bubbletea that referenced this issue Jul 16, 2024
We need to reset the cursor position to the beginning of the line when
the program stops or exit.

Related: charmbracelet/gum#607
aymanbagabas added a commit that referenced this issue Jul 16, 2024
We need to pause the main tea.Program process to restore the terminal
state before running the sub-process.

Fixes: #607
aymanbagabas added a commit that referenced this issue Jul 16, 2024
We need to pause the main tea.Program process to restore the terminal
state before running the sub-process.

Fixes: #607
@meowgorithm
Copy link
Member

Thanks for the heads up, @vt-alt! This is fixed in main and’ll be available in the next release.

@meowgorithm
Copy link
Member

Hi again! Just a note that this fix is now available in Gum v0.14.2.

@aymanbagabas
Copy link
Member

#621 has been reverted because it introduced another bug, reopening

@aymanbagabas aymanbagabas reopened this Jul 24, 2024
aymanbagabas added a commit that referenced this issue Jul 24, 2024
We don't need to check for isatty, always store the output to the
designated buffer.

Fixes: #607
@aymanbagabas aymanbagabas linked a pull request Jul 24, 2024 that will close this issue
@aymanbagabas aymanbagabas added bug Something isn't working cmd/spin labels Jul 25, 2024
@hanoii
Copy link

hanoii commented Oct 9, 2024

I am noticing also that on long lines, it's not truncating the lines to $COLUMNS as the normal command would.

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/spin
Projects
None yet
4 participants