fyne-io/terminal

Opening vim shows an empty screen (with the file name at the bottom)

andydotxyz opened this issue · 5 comments

A regression in the last month has somehow stopped vim from working on my Linux computer.

Cause was PR #64

The commit causing this appears to be a205930

I pushed a fix directly to master - it reverted always creating a new buffer.
It seems that on some Go or some platforms, the append on 0 length was not working as expected.

The current status is now part way between the original and the new - it only makes a new buffer when required, but also avoids corrupting buf by not writing into the same space...

Please let me know what you think @figuerom16

That's really strange. I'm trying to replicate the problem in PopOS opening vim, but I can't seem to recreate the issue.
Unfortunately the change does recreate the old issue where leftOver can suddenly fill up on resize.

fmt.Println("lenLeftOver", lenLeftOver)
Then doing something like systemctl status
Then rapidly resizing the terminal will show sizes greater than 3 and garble the screen.

The only other error I'm getting is
2024/02/19 23:11:53 Fyne error: Failed to parse color mode: >4
2024/02/19 23:11:53 Cause: strconv.Atoi: parsing ">4": invalid syntax
2024/02/19 23:11:53 At: /home/matt/Documents/go/terminal/color.go:76
I doubt that would cause an issue though, but it might be worth tracking it down.

Is there a way I can recreate the vim issue easily?

Found a way to disable the previous error. It's a special escape sequence that vim uses. >4;2m
metwork-framework/mfextaddon_vim#63
adding this setting to vimrc quiets it since the terminal isn't handling this special sequence.

let &t_TI = ""
let &t_TE = ""

I don't know if this was causing any issues with your vim though.

EDIT: thinking about this more if >4 is throwing an error then 2m gets processed. Wouldn't that mean that vims color mode gets set to Dim/Faint mode? Nevermind color mode 2 isn't being handled so it shouldn't cause an issue.

let &t_TI = ""
let &t_TE = ""

I don't know if this was causing any issues with your vim though.

Just to confirm I tested this and the warnings did go away but the error with not loading content in vim remains.