fyne-io / terminal

A graphical terminal emulator for Linux using Fyne
Other
252 stars 38 forks source link

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

Closed andydotxyz closed 8 months ago

andydotxyz commented 8 months ago

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

Cause was PR #64

andydotxyz commented 8 months ago

The commit causing this appears to be a2059303c4

andydotxyz commented 8 months ago

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

figuerom16 commented 8 months ago

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?

figuerom16 commented 8 months ago

Found a way to disable the previous error. It's a special escape sequence that vim uses. >4;2m https://github.com/metwork-framework/mfextaddon_vim/issues/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.

andydotxyz commented 8 months ago
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.