Closed DNDEBUG closed 2 years ago
also wtf is it 1|4|7 2|5|8 3|6|9
This is not exactly the same issue we had before: what I fixed before was the suggestions thing, which, being dependent upon the window size, is related to this, but not the same thing. I was already aware, specially since I was playing around with tilling window managers, that the interface (the files list) won't update automatically upon resizes: you need to refresh the screen manually (rf
).
It's not just a matter of adding a screen refresh routine triggered after each screen resize. This works fine provided we have a small list of files, but could become annoying when it comes to large amount of files, for example /bin
.
It's an implementation decision. Still trying to figure out the best approach to keep things ordered.
As to the columns issue, I'm running CliFM now on i3 using xterm as terminal emulator and cannot reproduce this issue. When I create a new window and close it, the area covered by the new window remains black (instead of being updated), while the unaffected part of the screen is fine. This is the issue I was talking about. But I'm not getting messed up columns.
The video starts with columns already messed up. Could you describe how to get them messed that way?
just make it like the first list but fit it horizontally 1: file1 2: file2 3: file3 4: file4 lets say a file has a long name it wont fit so instead of 1: file1 2: file2 3: file3 4: file_with_long_name do 1: file1 2: file2 3: file3 4: file_with_long_name
so its just the first list, but only for things that can fit in a column
the video starts with everything nomal i just open some windows to change the size and things get messed up
maybe you could set an warning like other programs do "the window needs to be the size XxW"
Great. So, it happens only when you list files horizontally instead of vertically, isn't it?
yeah
I see.
Trying to reproduce the issue now. But I'm not sure why your video shows the files list being updated upon window's resize. It shouldn't: I do was playing around with automatic screen refresh, but since I didn't get yet the expected results, removed that code.
maybe it depends on the terminal? the first resize changed the amount of files vertically but at some point the text started to be cut
It might be a terminal thing. I have observed before some columns issue with aterm (which isn't able to adequately render some fonts). But that's it.
Btw, since a few versions ago, trimming file names down to 20 chars is the new default. Maybe this prevents that issue.
Try installing the latest version with a fresh config file.
i am
Could you try with a different terminal? If you're using the latest version, and a fresh config file, I still don't get why the files list is automatically updated and file names not trimmed down.
vte2.91
zutty, the black thing happens
lxterminal
i believe lxterminal uses vte too
Reproduced!
Well, it's not CliFM who's refreshing the screen on resize, but the terminal emulator itself. However, I've tried a few other file managers and, despite getting the same behavior (the terminal performs the screen refresh itself), thing don't get messed up (maybe because they're all curses based, while CliFM isn't). And this is the expected behavior of course.
I'll keep working on this.
The feature is called rewrap on resize
. In vte-2.9 it could be disabled via the -R,--no-rewrap
switch.
EDIT:
I've found qterminal
, evilvte
, and vte
(legacy, 0.28.2) to behave quite nicely in this regard. Also, neither xterm
nor st
, rxvt
, eterm
, and aterm
, at the very least, enable rewrap on resize by default.
Sadly, most modern terminal emulators rewraps upon resize. I need to find a workaround for this.
After some testing and research I can conclude that this issue is not directly related to CliFM, but to non-curses programs printing directly to STDOUT in general. The terminal emulator, provided it rewraps on resize, messes up the current screen content (you need to resize to the original screen size to get the correct output back).
For example: run ls(1) on lxterminal
, resize the terminal window and you'll see the same distortion you observed in CliFM.
you should set a window size limit
Hi @DNDEBUG. After a few tries I came out with this solution:
However:
aterm
) are really slow at rendering characters on the screen. Setting a maximum amount of files below which the screen is refreshed, on the other side, is also completely arbitrary.i believe the size limit should be based on the amount of horizontal text so i could have a big screen and have a very small window and a small window with small text etc
this shouldn't be the default as the horizontal file isn't the default so you should specify this in the documentation if Y then X
vte and opengl terminals are mostly used so they are the ones that should be expected to be used by most people and these don't have such problems as being slow and having text rendering problems
you should add a mode for slow rendering like for example a page mode show 10 items, and the user can move around the pages go thought the file list instead of scrolling stuff
render once X amount of files, then render the next page if the user moves to the next page
i hope you get my idea
I'll keep working on it. Thanks for your suggestions!
Please give this new feature a try and tell me whether we can close this issue.
After a screen refresh, the prompt is not completely reprinted
Fixed.
there needs to be a logic on how things work but there are limitations that need to be accepted
Which are exactly those limitations? How that logic would be?
It's always possible to improve the implementation.
the terminal can only render text of course one can fiddle with unicode lines, use fancy fonts or that w3m thing to render images but the termainal is limited to text only and what it can do with text and the tecnology of what it does with the text if you implement something to work with vte it might not work on st
Well, that's one of the drawbacks of not working with the curses library. However, I think this new refresh on resize feature works quite fine and makes CliFM much more tilling WM/terminal multiplexer-friendly.
Hey @DNDEBUG! I've been working on this for the last few days, this time testing directly on a tiling WM (i3), and I think I finally got a quite decent implementation, specially regarding screen updates when opening files or running applications.
You might want to take a look at this. Any suggestion is welcome!
working great, no complaing for now i'll keep lookink for problems i will close it for now, but if anything comes i'll open it again
Hi @DNDEBUG! I completely refactored the refresh on resize
feature due to serious inconsistencies and bugs I've found in the previous implementation.
We basically hit here the limits of a pure text file manager: handling screen contents without a screen handling library (like curses
) proved to be a true mine field: event signals (mostly SIGWINCH), synchronous and asynchronous events, forbidden functions (like printf(3)
) inside signal handlers, unexpected/unmanageable screen events (due to the asynchronous nature of signals), external applications taking the whole screen corrupted, unrecoverable freezes, and so on, and so on.
The new implementation avoids all these pitfalls, at the expense of some automation though. Take a look at the note I wrote apropos.
Please give it a try and tell me what you think. Of course, fell free to reopen this issue if necessary.
testing the columns thing
https://user-images.githubusercontent.com/98880063/164946097-23fb86b6-376c-4e4c-886b-ce90bb485a5e.mp4