Replies: 20 comments 1 reply
-
|
Does this happen only with Ghostty? Have you enabled image previews? In that case, what preview method are you using? If running out of the box, it should be Is this happening also with regular TAB completion? |
Beta Was this translation helpful? Give feedback.
-
|
Spotted the issue. Here is it: Ghostty does support sixel in some experimental and even undocumented way, but it's only partially supported, generating the display issues you see on the screen. Now, why, despite the fact that clifm knows that this terminal does not support sixel ($CLIFM_IMG_SUPPORT is indeed set to Here's why: the Briefly stated, the command we use to fire up image previews isn't working as expected. As a workaround, edit chafa) chafa --symbols=all -s "${C}x${L}" "$1" ;;by this one: chafa) chafa -f symbols -s "${C}x${L}" "$1" ;;to force Drawback, only ANSI images will be displayed, but since sixel support is at most half of its way, this is the only thing this terminal can offer right now. As a side note, the A fun/weird/buggy fact. On chafa -f sixels image.jpgNothing, no image is displayed. Now run this other command: chafa image.jpgA sixel image! Why on earth is this happening? |
Beta Was this translation helpful? Give feedback.
-
|
Also, as a proof of concept. Go to your images directory, and run (not in clifm, but in you regular shell): ls | fzf --preview 'chafa {}'You'll see the same scrolling issue. Conclusion: this is not our issue. |
Beta Was this translation helpful? Give feedback.
-
|
Thank you for the detailed response. I'll look into it later. |
Beta Was this translation helpful? Give feedback.
-
|
According to this issue Ghostty will definitely not support sixels. The question still remains: how to explain the behavior exposed above? I've taken a look at the source code, and there's not a single word about sixels. Weird. |
Beta Was this translation helpful? Give feedback.
-
|
Found out that if you reduce the size of the image displayed by chafa you can make the scroll thing go away: chafa) chafa --symbols=all -s "${C}x$((L - 2))" "$1" ;;However, images are still not cleared, which makes it rather useless. |
Beta Was this translation helpful? Give feedback.
-
Is it possible that in this case is equivalent to |
Beta Was this translation helpful? Give feedback.
-
|
I've found I've just noticed that this is practically what you did. |
Beta Was this translation helpful? Give feedback.
-
|
You're right. I completely overlooked the fact that Ghostty supports the Kitty graphics protocol. Regarding the
# ~/.config/clifm/clifmimg:148
chafa) chafa --view-size "${C}x${L}" "$1" ;;
|
Beta Was this translation helpful? Give feedback.
-
|
After taking a look at this script, I've found out how to solve the clearing issue. Edit However, we still have some displaying issues with big images. Fixed this by just reducing the width. # ~/.config/clifm/clifmimg:232
kitty)
kitty icat --loop=0 --place "$((FZF_PREVIEW_COLUMNS - 2))x$((FZF_PREVIEW_LINES - 1))@${X}x${Y}" \
--clear --transfer-mode=memory --unicode-placeholder --stdin=no --align=left "$1"
;; |
Beta Was this translation helpful? Give feedback.
-
Done. Now kitty is automatically detected if running on Ghostty (no need to set the EDIT: With the latest commit, both issues are definitely fixed. The new code for kitty images is this: # ~/.config/clifm/clifmimg:232
kitty)
kitty icat --loop=0 --place "${C}x$((L - 1))@${X}x${Y}" \
--clear --transfer-mode=memory --unicode-placeholder --stdin=no --align=left "$1"
;; |
Beta Was this translation helpful? Give feedback.
-
|
Does it mean that I need to install |
Beta Was this translation helpful? Give feedback.
-
|
I was thinking about the same thing. Definitely not good, so maybe I'll revert back the commit making Ghostty terminals automatically use the On the other side, without the EDIT: We need to replicate the behavior of the |
Beta Was this translation helpful? Give feedback.
-
|
Can we use a wrapper around |
Beta Was this translation helpful? Give feedback.
-
|
Gave this try, but it doesn't work. This is the script I've tried: ~/.chafa.sh #!/bin/sh
clear
chafa -f kitty --clear --view-size "${1}x${2}" "$3"invoked from chafa) ~/chafa.sh "$C" "$L" "$1" ;;Nothing, the image isn't cleared. I've even tried replacing BTW. whatever clear command we use, the text is removed as expected, but not the image, which remains on top. As a side note, the clear command can be used directly in the chafa) clear; chafa -f kitty --clear --view-size "${C}x${L}" "$1" ;; |
Beta Was this translation helpful? Give feedback.
-
|
Seems we've gone back to this unresolved issue. |
Beta Was this translation helpful? Give feedback.
-
|
I've even tried the fzf-preview script provided by |
Beta Was this translation helpful? Give feedback.
-
|
Tried with two other terminals with support for the Kitty graphics protocol: Konsole and Wezterm.
The command I'm using is this: ls *.png *.jpg | fzf --preview 'chafa -f kitty --clear {}'It's not clear what conclusions can be drawn from this, but at least we know that Ghostty is not alone in this. I thought about taking a look at how other programs generate image previews via the Kitty protocol. Ranger can do this, so let's see how it goes. Tried three terminals with kitty support. The results:
It seems it's hard to make the kitty protocol work outside the kitty terminal itself. |
Beta Was this translation helpful? Give feedback.
-
|
I wonder if it is caused by graphics being at a different address. May be we are not clearing the buffer with the image. |
Beta Was this translation helpful? Give feedback.
-
|
The only way I know that actually works is with |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the bug
Screen scrolls up one line when entering
viewmode underGhosttyterminal emulator.To Reproduce
Steps to reproduce the behavior:
clifmunderGhostty.viewcommand.Expected behavior
The screen should look like this:
Screenshots
Instead it looks like this:
Desktop
Beta Was this translation helpful? Give feedback.
All reactions