runtime error: index out of range [150] with length 150
For some reason I have the output of log messed up for one specific changeset (changesets completely disaligned) but only when enabling preview:
➜ jjui --version
fa3ba9ee7f758096d0799b1d2d23c31c08545850
➜ jjui
Caught panic:
runtime error: index out of range [150] with length 150
Restoring terminal...
goroutine 1 [running]:
runtime/debug.Stack()
runtime/debug/stack.go:26 +0x5e
runtime/debug.PrintStack()
runtime/debug/stack.go:18 +0x13
github.com/charmbracelet/bubbletea.(*Program).recoverFromPanic(0xc0001803c0, {0x64cb00, 0xc00016d770})
github.com/charmbracelet/[email protected]/tea.go:810 +0xac
github.com/charmbracelet/bubbletea.(*Program).Run.func2()
github.com/charmbracelet/[email protected]/tea.go:601 +0xe8
panic({0x64cb00?, 0xc00016d770?})
runtime/panic.go:792 +0x132
github.com/idursun/jjui/internal/screen.(*cellBuffer).merge(0xc00083c3f8, {0xc0001e0000?, 0x578a?, 0x4d9e45?}, 0x0, 0x0)
github.com/idursun/jjui/internal/screen/cell_buffer.go:113 +0x88a
github.com/idursun/jjui/internal/screen.(*cellBuffer).applyANSI(0xc00083c3f8, {0xc0001e0000, 0x578a, 0x6000}, 0x0, 0x0)
github.com/idursun/jjui/internal/screen/cell_buffer.go:58 +0xf4
github.com/idursun/jjui/internal/screen.Stacked({0xc000496000?, 0xce0?}, {0xc00015f000, 0xce0}, 0x57, 0xe)
github.com/idursun/jjui/internal/screen/cell_buffer.go:43 +0x6b
github.com/idursun/jjui/internal/ui.Model.View({0xc0003c2608, 0x0, 0xc00045c008, 0xc000444008, 0x1, 0x4049000000000000, 0x0, 0x0, {0x0, 0x0}, ...})
github.com/idursun/jjui/internal/ui/ui.go:263 +0x645
github.com/charmbracelet/bubbletea.(*Program).eventLoop(0xc0001803c0, {0x7290e8?, 0xc0003c3908?}, 0xc00042c4d0)
github.com/charmbracelet/[email protected]/tea.go:533 +0x892
github.com/charmbracelet/bubbletea.(*Program).Run(0xc0001803c0)
github.com/charmbracelet/[email protected]/tea.go:679 +0xb56
main.main()
github.com/idursun/jjui/cmd/jjui/main.go:112 +0x36a
Error running program: program was killed: program experienced a panic
Hey, thanks for the report.
This looks like an edge case (literally) in cell_buffer implementation.
Is the jj log output misaligned as well?
Would you be able to share the description of that change id by running jj log -r <changeid here> -T 'description' --no-graph > output.txt?
this only happens when preview is enabled, else it displays fine (jj log is fine). The result of the command is added mlxtran model
Not sure how the preview works but the file to be previewd contains several dangerous characters like brackets and so on. Could it confuse the previewer ? something like ...
<DATAFILE>
[FILEINFO]
file='../toto.csv
delimiter = semicolon
header={PATIDENT, DATE_OF_LAST_INTAKE}
[CONTENT]
STUDYID = {use=covariate, type=categorical}
I suspect Carriage Return \r characters are causing the issue here. If you can dump the description into a file and look at the hex view then you should see some \r\n at the end of the lines.
I ran jj show PROBLEMATIC_CHANGE | cat -A and all I see are newlines:
$
my description$
$
not sure tht's what you asked for though ^^'
I can also report this:
Caught panic:
runtime error: index out of range [186] with length 186
Restoring terminal...
goroutine 1 [running]:
runtime/debug.Stack()
runtime/debug/stack.go:26 +0x5e
runtime/debug.PrintStack()
runtime/debug/stack.go:18 +0x13
github.com/charmbracelet/bubbletea.(*Program).recoverFromPanic(0xc00049c000, {0x64df40, 0xc000316798})
github.com/charmbracelet/[email protected]/tea.go:810 +0xac
github.com/charmbracelet/bubbletea.(*Program).Run.func2()
github.com/charmbracelet/[email protected]/tea.go:601 +0xe8
panic({0x64df40?, 0xc000316798?})
runtime/panic.go:792 +0x132
github.com/idursun/jjui/internal/screen.(*cellBuffer).merge(0xc00075c338, {0xc00085a000?, 0xbad8?, 0x4d9e45?}, 0x0, 0x0)
github.com/idursun/jjui/internal/screen/cell_buffer.go:113 +0x88a
github.com/idursun/jjui/internal/screen.(*cellBuffer).applyANSI(0xc00075c338, {0xc00085a000, 0xbad8, 0xc000}, 0x0, 0x0)
github.com/idursun/jjui/internal/screen/cell_buffer.go:58 +0xf4
github.com/idursun/jjui/internal/screen.Stacked({0xc00083e000?, 0xce0?}, {0xc0007ff000, 0xce0}, 0x5f, 0x3c)
github.com/idursun/jjui/internal/screen/cell_buffer.go:43 +0x6b
github.com/idursun/jjui/internal/ui.Model.View({0xc0003ea608, 0x0, 0xc00049a008, 0xc00047a008, 0x1, 0x4049000000000000, 0x0, 0x1, {0x0, 0x0}, ...})
github.com/idursun/jjui/internal/ui/ui.go:265 +0x645
github.com/charmbracelet/bubbletea.(*Program).eventLoop(0xc00049c000, {0x730a68?, 0xc0003ecc08?}, 0xc000472700)
github.com/charmbracelet/[email protected]/tea.go:533 +0x892
github.com/charmbracelet/bubbletea.(*Program).Run(0xc00049c000)
github.com/charmbracelet/[email protected]/tea.go:679 +0xb56
main.main()
github.com/idursun/jjui/cmd/jjui/main.go:113 +0x385
Error running program: program was killed: program experienced a panic
for me it happens only on the one change. I also see a very similar artifact on the screen, which goes away when switching to another change and when I press e.g. 'b' it crashes. Disabling the preview sidesteps this.
Most interesting fact about that change is that it has a rather long bookmark name.
Thanks! Can any of you be able to check if Is this still happening after d851118?
I had a new occurence on a brand new commit so I decided to try it out and now I have wtih c29ca6c
Caught panic:
invalid background parameter ""
Restoring terminal...
goroutine 1 [running]:
runtime/debug.Stack()
runtime/debug/stack.go:26 +0x5e
runtime/debug.PrintStack()
runtime/debug/stack.go:18 +0x13
github.com/charmbracelet/bubbletea.(*Program).recoverFromPanic(0xc0001863c0, {0x61e820, 0xc00090a8e0})
github.com/charmbracelet/[email protected]/tea.go:810 +0xac
github.com/charmbracelet/bubbletea.(*Program).Run.func2()
github.com/charmbracelet/[email protected]/tea.go:601 +0xe8
panic({0x61e820?, 0xc00090a8e0?})
runtime/panic.go:792 +0x132
github.com/idursun/jjui/internal/screen.Segment.WithBackground({{0x737f00, 0x1}, {0xc00019a010, 0x6}, 0x0}, {0x0, 0x0})
github.com/idursun/jjui/internal/screen/segment.go:82 +0x3e5
github.com/idursun/jjui/internal/ui/graph.(*DefaultRowIterator).Render-range1(0xc00035a300)
github.com/idursun/jjui/internal/ui/graph/default_row_iterator.go:106 +0x319
github.com/idursun/jjui/internal/ui/graph.(*DefaultRowIterator).Render.(*Row).RowLinesIter.func2(...)
@teto which terminal emulator are you using?
I reverted to 0.8.12 and funnily enough I hit the same issue
Caught panic:
invalid background parameter ""
Restoring terminal...
goroutine 1 [running]:
runtime/debug.Stack()
runtime/debug/stack.go:26 +0x5e
runtime/debug.PrintStack()
runtime/debug/stack.go:18 +0x13
github.com/charmbracelet/bubbletea.(*Program).recoverFromPanic(0xc0001863c0, {0x61c480, 0xc000113670})
github.com/charmbracelet/[email protected]/tea.go:810 +0xac
github.com/charmbracelet/bubbletea.(*Program).Run.func2()
github.com/charmbracelet/[email protected]/tea.go:601 +0xe8
panic({0x61c480?, 0xc000113670?})
and I realized that I had not the same behavior in and outside of a nix devShell:
- jjui would work fine in my standard user zsh session
- entering the devShell of a (private) project with
nix develop, my shell becomes /nix/store/9nw8b61s8lfdn8fkabxhbz0s775gjhbr-bash-5.2p37/bin/bash and jjui breaks on the same commit.
I am using the kitty terminal (0.42.1)
I ran into this today for first time as well, using kitty version 0.42.2. I'm running on macOS within a Nix shell as well, with zsh as my command shell.
@seh which version of jjui are you on? jjui --version should print the version information.
Thanks, and one last question, I assume this happens when you open one of the modal dialogs (e.g. git, bookmarks) or when a flash message is supposed to show up, this correct?
I am asking because I am having hard time reproducing it on my end.
Ignore my previous question, I think this is happening as some of the variables in a nix shell. Separate from the original reported issue. I will have a look at this.
what I've seen in other projects is that the '$SHELL' variable is not necessarily the running shell, notably SHELL will point at a noninteractive bash (nixpkgs provides 2 versions of bash, one interactive and a barebones one), while current shell is different cat /proc/$$/cmdline but the program you launch uses $SHELL to spawn new shells. And then you get weird behaviors
I assume this happens when you open one of the modal dialogs (e.g. git, bookmarks) or when a flash message is supposed to show up, this correct?
In my case, I find that this happens when I press the 'l' key (for details) on a particular commit that involved only six files. I don't see anything noteworthy about the commit. It bears no bookmarks or references from Git tags or branches.