bloznelis / typioca

Cozy typing speed tester in terminal
MIT License
750 stars 22 forks source link

Broken on Windows #32

Closed Douloureux closed 2 years ago

Douloureux commented 2 years ago

When I build Typioca on Windows, it completes with no errors, but when I run it, I can only get to the main menu, and if I try to open a typing test, this happens

PS D:\src\typioca\execs> .\typioca.exe
Caught panic:

strings: negative Repeat count

Restoring terminal...

goroutine 1 [running]:
runtime/debug.Stack()
        runtime/debug/stack.go:24 +0x65
runtime/debug.PrintStack()
        runtime/debug/stack.go:16 +0x19
github.com/charmbracelet/bubbletea.(*Program).StartReturningModel.func3()
        github.com/charmbracelet/bubbletea@v0.20.0/tea.go:359 +0x95
panic({0xb2a220, 0xc50940})
        runtime/panic.go:844 +0x258
strings.Repeat({0xc4f958?, 0xc00000b0d8?}, 0x1?)
        strings/strings.go:533 +0x4d8
github.com/muesli/reflow/indent.(*Writer).Write(0xc00005ac30, {0xc00010cd48?, 0xd, 0xd?})
        github.com/muesli/reflow@v0.3.0/indent/indent.go:78 +0x172
github.com/muesli/reflow/indent.Bytes({0xc00010cd48, 0xd, 0x20}, 0xfffffffffffffff7)
        github.com/muesli/reflow@v0.3.0/indent/indent.go:48 +0xa8
github.com/muesli/reflow/indent.String(...)
        github.com/muesli/reflow@v0.3.0/indent/indent.go:56
main.model.indent(...)
        github.com/bloznelis/typioca/src/view.go:258
main.model.View({{0xb68fe0, 0xc000178000}, {0xc000004438, 0xc000004450, 0xc00000abe0, 0xbf6da0, 0xc00000abf0, 0xc00000ac00, 0xc00000ac10, 0xc00000ac20}, ...})
        github.com/bloznelis/typioca/src/view.go:152 +0x1df7
github.com/charmbracelet/bubbletea.(*Program).StartReturningModel(0xc00013a100)
        github.com/charmbracelet/bubbletea@v0.20.0/tea.go:549 +0x1378
github.com/charmbracelet/bubbletea.(*Program).Start(...)
        github.com/charmbracelet/bubbletea@v0.20.0/tea.go:556
main.glob..func1(0xe0cf80?, {0xb85c94?, 0x0?, 0x0?})
        github.com/bloznelis/typioca/src/main.go:57 +0x22a
github.com/spf13/cobra.(*Command).execute(0xe0cf80, {0xc00004c230, 0x0, 0x0})
        github.com/spf13/cobra@v1.4.0/command.go:856 +0x67c
github.com/spf13/cobra.(*Command).ExecuteC(0xe0cf80)
        github.com/spf13/cobra@v1.4.0/command.go:974 +0x3b4
github.com/spf13/cobra.(*Command).Execute(...)
        github.com/spf13/cobra@v1.4.0/command.go:902
main.main()
        github.com/bloznelis/typioca/src/main.go:124 +0x25
bye!
bloznelis commented 2 years ago

Looks wildly similar to https://github.com/bloznelis/typioca/issues/30. I bet the root cause is the same, will try to figure this one out, thanks for reporting @Douloureux

bloznelis commented 2 years ago

Should be fixed by 1.2.3 @Douloureux !

Douloureux commented 2 years ago

Thank you! I really love Typioca I use it a lot on Linux, I've recommended it to all my friends too, they all love it, great alternative to the typing websites.