charmbracelet / gum

A tool for glamorous shell scripts 🎀
MIT License
17.94k stars 339 forks source link

gum spin messes the screen #607

Open vt-alt opened 3 months ago

vt-alt commented 3 months ago

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):

meowgorithm commented 2 months ago

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

meowgorithm commented 2 months ago

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

aymanbagabas commented 2 months ago

https://github.com/charmbracelet/gum/pull/621 has been reverted because it introduced another bug, reopening