[BUG] UI dimensions not calculated properly when in neovim terminal
Description:
When I have lf open, and open a second window next to it (in a tiling WM), the UI is not correctly redrawn (see imgs).
Does not happen always, but like 80% of the time. The UI is not redrawn correctly when I change the folder. However, it is redrawn correctly when I start typing a command after the first letter it looks correct.
Steps to reproduce:
- Run lf
- Open another program next to it
- See unresized UI
System:
- Manjaro I3
lfversion r24
Before opening a second window

After opening a second window

@Dimfred It sounds like resize event is not fired for some reason. I also have an i3 setup on my machine but I don't have this issue. Can you try with different terminals to see if it makes a difference?
Okay you were right. So the bug only appears when I am running a neovim terminal (which I always do by default). Tried with kitty and xterm plain and both running neovim terminal. Bug appears only with the neovim terminal.
@Dimfred Is there anything lf specific then? Can you reproduce this issue in other terminal applications? If so, maybe you can report the issue to neovim.
Yeah the problem is I cannot reproduce it in ranger. Therefore, not sure whether this is really neovim related. Also what I find interesting that the event is fired when I start typing a command. So after the first char the UI is correct, are you normally checking after each typed char whether the UI is correct? Would seem weird, but I guess no.
@Dimfred We simply process resize events as they are delivered by tcell. It is possible this issue is specific to applications written in tcell. If you are using another tcell application, maybe you can try to reproduce it in that program. There is a list in the tcell readme.
@gokcehan Thanks for your fast responses. I tried three programs from that list. It seems to be lf only related.
Can you maybe try to reproduce?
nvim
:term
lf
*open another window right of lf*
@Dimfred I'm able to reproduce the issue. In my case, resize event is fired in all cases but dimensions are not calculated properly only in some directories. I can't think of anything that might be the cause at this point. But I'm not familiar with neovim terminal anyways. Hopefully, someone that is effected by this issue can come up with a fix. Feel free to rename the issue title to include neovim terminal if you like so it might catch more attention from people with more involvement.
Thx for the debugging help, yes will do. Maybe I start diving into it, wanted anyways to know more about go and neovim, so seems like thats my chance.
Could you maybe point me to the part where the dimensions are calculated in lf, I will probably try to port it from ranger, since it is working on their side.