clifm
clifm copied to clipboard
Ueberzug does not display in the correct preview window when using fzfnav
Hello,
I tried the fzfnav plugin last night, pretty much using the out-of-the-box configuration. I set PDF="pdftoppm" and IMG="ueberzug" and put the preview cache directory to default. The pdf preview works but it is displayed on the left side of the screen, covering the entire fzf UI from view. Is this the desired default behaviour or am I missing something? I checked the fzfnav script to see if there is any obvious way to change this, if so it would be good to add something to the documentation. I am running the latest AUR build.
Thank you in advance for any help
Hi @kjk11. Thanks for reporting this. I'll try to reproduce the issue and fix it as soon as possible. I'll let you know.
Are you using clifm
or clifm-git
?
Thank you for the swift response, I am using clifm from the AUR, re-compiled earlier today. System is mainline arch, up to date.
What terminal emulator are you using?
I am usually using st, but the issue persists if I use a different emulator e.g. mlterm.
This is a screenshot for reference. On the left you would normally see the list of files in the current directory but this is obscured by the pdf preview, which should have appeared in the window on the right.
It seems to be a problem with ueberzug's screen coordinates. These coordinates are calculated by the calculate_position
function (variables X
and Y
), in BFG.sh
.
The meaning of the variables in this function is: TERM_LINES and TERM_COLS hold the number of lines and columns of the terminal window respectively, while LINES and COLUMNS refer rather to the preview window's size.
I'm still unable to reproduce the issue. In the meanwhile, you can play around with these values and report if you find something useful. If you could report the values used by this function (TERM_COLS, TERM_LINES, COLUMNS and LINES), plus the result values (X
and Y
), that would be useful.
You can also try replacing X
(columns) and Y
(lines) by some fixed values, for instance 40 and 6 respectively (this works for my terminal, whose size is 23 (lines) and 75 (columns)) .
Btw, have you tried the latest development build (clifm-git
): there have been a few changes in the fzfnav
plugin, so maybe....
I have now switched to clifm-git, however it has not changed the position of the preview much. The variable values obtained by the function are: TERM_LINES=36 and TERM_COLS=117 If I modify these values to, say TERM_LINES=20 and TERM_COLS=180, the position is roughly correct (but the preview is still much larger than the little preview rectangle on the right).
Try modifying WIDTH
and HEIGHT
values in BGH.sh
. Those are fixed values, and maybe they're the source of your issue.
WIDTH
and HEIGHT
do not affect the position of the preview (as one might expect). If I decrease them, the size of the image decreases but only up to a certain point. With both set to zero, most previews are still large than the box on the right, which does not bother me. So right now setting the values for TERM_LINES
and TERM_COLS
manually works as a fix as long as the window is not resized and I do not use a different screen.
Far from ideal, of course, but at least it works. If I were you, I'd try modifying the values of LINES and COLUMNS, since they express the size of the PREVIEW window. Remember that TERM_LINES and TERM_COLS refer to size of the terminal window: this latter values should be those you get querying your terminal size from the command line: echo "$LINES $COLUMNS"
or stty size
. Then, LINES and COLUMNS should be quite smaller. In my case:
- TERM_LINES: 23
- TERM_COLS: 75
- LINES: 15
- COLUMNS: 33
- X: 40
- Y: 7
This is only to give you an idea of the right proportion.
I'll keep working on this. I just need to reproduce the issue: tried on several boxes, and still nothing.
Hi @kjk11. The issue was never reproduced, but the new view
command (a completely new file preview implementation, and thereby still experimental) might be the solution to the problem.
To add image preview support (requires X11 and ueberzug) see https://github.com/leo-arch/clifm/tree/master/misc/tools/imgprev#image-previews-via-ueberzug
Give it a try and let me know if it works for you.
Hey @kjk11! Have you tried the new view
command? Does it work for you?
Hi leo-arch,
My apologies, I am currently not playing around with clifm. But I intend to come back to it once I have more capacity and report here.
Hi @kjk11. No problem. Your feedback will always be welcome.
The fzfnav
plugin has been basically replaced by the view
command (tough we keep it as a plugin, it makes no harm), so we can close this issue. However, please feel free to reopen it whenever you think it fit.