Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Graphical preview isnt updated properly with custom init.lua #1377

Open
SolitudeSF opened this issue Jul 31, 2024 · 1 comment
Open

Graphical preview isnt updated properly with custom init.lua #1377

SolitudeSF opened this issue Jul 31, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@SolitudeSF
Copy link
Contributor

SolitudeSF commented Jul 31, 2024

What system are you running Yazi on?

Linux X11

What terminal are you running Yazi in?

kitty master

yazi --debug output

Yazi
    Version: 0.2.5 (4257b95 2024-07-31)
    Debug  : false
    OS     : linux-x86_64 (unix)

Ya
    Version: 0.2.5

Emulator
    Emulator.via_env: ("xterm-kitty", "")
    Emulator.via_csi: Ok(Kitty)
    Emulator.detect : Kitty

Adapter
    Adapter.matches: Kitty

Desktop
    XDG_SESSION_TYPE: Some("tty")
    WAYLAND_DISPLAY : None
    DISPLAY         : Some(":1")

SSH
    shared.in_ssh_connection: false

WSL
    /proc/sys/fs/binfmt_misc/WSLInterop: false

Variables
    SHELL              : Some("/bedrock/cross/bin/bash")
    EDITOR             : Some("kak")
    YAZI_FILE_ONE      : None
    YAZI_CONFIG_HOME   : None
    ZELLIJ_SESSION_NAME: None

Text Opener
    default: Some(Opener { run: "${EDITOR:=vi} \"$@\"", block: true, orphan: false, desc: "$EDITOR", for_: None, spread: true })
    block  : Some(Opener { run: "${EDITOR:=vi} \"$@\"", block: true, orphan: false, desc: "$EDITOR", for_: None, spread: true })

tmux
    TMUX   : false
    Version: No such file or directory (os error 2)

Dependencies
    file             : 5.45
    ueberzugpp       : No such file or directory (os error 2)
    ffmpegthumbnailer: 2.2.2
    magick           : 7.1.1-29
    fzf              : 0.54.0
    fd               : 10.1.0
    rg               : 14.1.0
    chafa            : No such file or directory (os error 2)
    zoxide           : No such file or directory (os error 2)
    7z               : 24.07
    7zz              : No such file or directory (os error 2)
    jq               : 1.7.1

Did you try the latest nightly build to see if the problem got fixed?

Yes, and I updated the debug information above (yazi --debug) to the nightly that I tried

Describe the bug

Moving from text preview to graphical (image/video), leaves holes in the image where the text was in the previous preview, with custom init.lua
image

Expected Behavior

no artifacting.

To Reproduce

This section is required in init.lua for artifacting to appear.

function Header:free()
	local handle = io.popen('echo yes')
	local output = handle:read('*a')
	handle:close()
	return ui.Line { ui.Span(string.sub(output, 1, -1) .. " ") }
end

function Header:render()
	local right = ui.Line { self:free(), self:count(), self:tabs() }
	local left = ui.Line { self:cwd(math.max(0, self._area.w - right:width())) }
	return {
		ui.Paragraph(self._area, { left }),
		ui.Paragraph(self._area, { right }):align(ui.Paragraph.RIGHT),
	}
end

preview window must be big enough so that image wont get downscaled.
hover over text file then hover over graphical file. sometimes its racy, but on certain files it always reproduces.

@SolitudeSF SolitudeSF added the bug Something isn't working label Jul 31, 2024
@SolitudeSF
Copy link
Contributor Author

easire init.lua reproducer

function Header:free()
	local handle = io.popen('fsfree')
	local output = handle:read('*a')
	handle:close()
	return ui.Line { ui.Span(string.sub(output, 1, -1) .. " ") }
end

Header:children_add("free", 900, Header.RIGHT)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant