sxyazi / yazi

💥 Blazing fast terminal file manager written in Rust, based on async I/O.
https://yazi-rs.github.io
MIT License
14.66k stars 332 forks source link

Image/PDF preview is at wrong place with wrong dimensions after closing the terminal with yazi open #893

Closed BennyOe closed 5 months ago

BennyOe commented 5 months ago

What system are you running Yazi on?

Linux X11

What terminal are you running Yazi in?

Suckless Simple Terminal (st)

Did you try the latest main branch to see if the problem got fixed?

Tried, but the problem still

yazi --debug output

```sh Yazi yazi 0.2.4 (Arch Linux 2024-03-10) Environment OS: linux-x86_64 (unix) Debug: false Emulator Emulator.via_env: ("st-256color", "") Emulator.via_csi: Ok(Unknown([])) Emulator.detect: Unknown([]) Adaptor Adaptor.matches: X11 tmux TMUX: false Zellij ZELLIJ_SESSION_NAME: None Desktop XDG_SESSION_TYPE: Some("x11") WAYLAND_DISPLAY: None DISPLAY: Some(":0") Ueberzug Version: Ok(Output { status: ExitStatus(unix_wait_status(0)), stdout: "ueberzugpp 2.9.4\n", stderr: "" }) WSL /proc/sys/fs/binfmt_misc/WSLInterop: false ```

Describe the bug

When I run yazi in the terminal everything works and the preview is looking good. But when I close the terminal without exiting yazi before and then reopen yazi in a new terminal the preview is messed up. This can only be undone by a system restart. image

Expected Behavior

When closing the terminal with yazi open and open it again on another terminal, the preview should still be in place. image

To Reproduce

This is happening on Arch Linux with dwm as window manager and st as terminal emulator.

Configuration

[manager]
ratio          = [ 1, 4, 3 ]
sort_by        = "alphabetical"
sort_sensitive = false
sort_reverse   = false
sort_dir_first = true
linemode       = "size"
show_hidden    = false
show_symlink   = true
scrolloff      = 5

[preview]
tab_size        = 2
max_width       = 600
max_height      = 900
cache_dir       = ""
image_filter    = "triangle"
image_quality   = 75
sixel_fraction  = 15
ueberzug_scale  = 1
ueberzug_offset = [ 0, 0, 0, 0 ]

[opener]
edit = [
    { run = '${EDITOR:=vi} "$@"', desc = "$EDITOR", block = true, for = "unix" },
    { run = 'code "%*"',          orphan = true, for = "windows" },
]
open = [
    { run = 'xdg-open "$@"',                desc = "Open", for = "linux" },
    { run = 'open "$@"',                    desc = "Open", for = "macos" },
    { run = 'start "" "%1"', orphan = true, desc = "Open", for = "windows" },
    { run = 'zathura "$@"', desc = "Open PDF", for = "unix", mime = "application/pdf" }
]
reveal = [
    { run = 'open -R "$1"',                          desc = "Reveal", for = "macos" },
    { run = 'explorer /select, "%1"', orphan = true, desc = "Reveal", for = "windows" },
    { run = '''exiftool "$1"; echo "Press enter to exit"; read''', block = true, desc = "Show EXIF", for = "unix" },
]
extract = [
    { run = 'unar "$1"', desc = "Extract here", for = "unix" },
    { run = 'unar "%1"', desc = "Extract here", for = "windows" },
]
play = [
    { run = 'mpv "$@"', orphan = true, for = "unix" },
    { run = 'mpv "%1"', orphan = true, for = "windows" },
    { run = '''mediainfo "$1"; echo "Press enter to exit"; read''', block = true, desc = "Show media info", for = "unix" },
]

[open]
rules = [
    { name = "*/", use = [ "edit", "open", "reveal" ] },

    { mime = "text/*",  use = [ "edit", "reveal" ] },
    { mime = "image/*", use = [ "open", "reveal" ] },
    { mime = "video/*", use = [ "play", "reveal" ] },
    { mime = "audio/*", use = [ "play", "reveal" ] },
    { mime = "inode/x-empty", use = [ "edit", "reveal" ] },

    { mime = "application/json", use = [ "edit", "reveal" ] },
    { mime = "*/javascript",     use = [ "edit", "reveal" ] },

    { mime = "application/zip",             use = [ "extract", "reveal" ] },
    { mime = "application/gzip",            use = [ "extract", "reveal" ] },
    { mime = "application/x-tar",           use = [ "extract", "reveal" ] },
    { mime = "application/x-bzip",          use = [ "extract", "reveal" ] },
    { mime = "application/x-bzip2",         use = [ "extract", "reveal" ] },
    { mime = "application/x-7z-compressed", use = [ "extract", "reveal" ] },
    { mime = "application/x-rar",           use = [ "extract", "reveal" ] },
    { mime = "application/xz",              use = [ "extract", "reveal" ] },

    { mime = "*", use = [ "open", "reveal" ] },
]

[tasks]
micro_workers    = 10
macro_workers    = 25
bizarre_retry    = 5
image_alloc      = 536870912  # 512MB
image_bound      = [ 0, 0 ]
suppress_preload = false

[plugin]

preloaders = [
    { name = "*", cond = "!mime", run = "mime", multi = true, prio = "high" },
    # Image
    { mime = "image/vnd.djvu", run = "noop" },
    { mime = "image/*",        run = "image" },
    # Video
    { mime = "video/*", run = "video" },
    # PDF
    { mime = "application/pdf", run = "pdf" },
]
previewers = [
    { name = "*/", run = "folder", sync = true },
    # Code
    { mime = "text/*",                 run = "code" },
    { mime = "*/xml",                  run = "code" },
    { mime = "*/javascript",           run = "code" },
    { mime = "*/x-wine-extension-ini", run = "code" },
    # JSON
    { mime = "application/json", run = "json" },
    # Image
    { mime = "image/vnd.djvu", run = "noop" },
    { mime = "image/*",        run = "image" },
    # Video
    { mime = "video/*", run = "video" },
    # PDF
    { mime = "application/pdf", run = "pdf" },
    # Archive
    { mime = "application/zip",             run = "archive" },
    { mime = "application/gzip",            run = "archive" },
    { mime = "application/x-tar",           run = "archive" },
    { mime = "application/x-bzip",          run = "archive" },
    { mime = "application/x-bzip2",         run = "archive" },
    { mime = "application/x-7z-compressed", run = "archive" },
    { mime = "application/x-rar",           run = "archive" },
    { mime = "application/xz",              run = "archive" },
    # Fallback
    { name = "*", run = "file" },
]

[input]
# cd
cd_title  = "Change directory:"
cd_origin = "top-center"
cd_offset = [ 0, 2, 50, 3 ]

# create
create_title  = "Create:"
create_origin = "top-center"
create_offset = [ 0, 2, 50, 3 ]

# rename
rename_title  = "Rename:"
rename_origin = "hovered"
rename_offset = [ 0, 1, 50, 3 ]

# trash
trash_title     = "Move {n} selected file{s} to trash? (y/N)"
trash_origin    = "top-center"
trash_offset    = [ 0, 2, 50, 3 ]

# delete
delete_title    = "Delete {n} selected file{s} permanently? (y/N)"
delete_origin   = "top-center"
delete_offset   = [ 0, 2, 50, 3 ]

# filter
filter_title  = "Filter:"
filter_origin = "top-center"
filter_offset = [ 0, 2, 50, 3 ]

# find
find_title  = [ "Find next:", "Find previous:" ]
find_origin = "top-center"
find_offset = [ 0, 2, 50, 3 ]

# search
search_title  = "Search via {n}:"
search_origin = "top-center"
search_offset = [ 0, 2, 50, 3 ]

# shell
shell_title  = [ "Shell:", "Shell (block):" ]
shell_origin = "top-center"
shell_offset = [ 0, 2, 50, 3 ]

# overwrite
overwrite_title  = "Overwrite an existing file? (y/N)"
overwrite_origin = "top-center"
overwrite_offset = [ 0, 2, 50, 3 ]

# quit
quit_title  = "{n} task{s} running, sure to quit? (y/N)"
quit_origin = "top-center"
quit_offset = [ 0, 2, 50, 3 ]

[select]
open_title  = "Open with:"
open_origin = "hovered"
open_offset = [ 0, 1, 50, 7 ]

[which]
sort_by        = "none"
sort_sensitive = false
sort_reverse   = false

[log]
enabled = false

Anything else?

This is the log output

  2024-04-10T13:17:23.988113Z ERROR yazi_scheduler::preload::preload: Preload task `image` returned 2
    at yazi-scheduler/src/preload/preload.rs:42

  2024-04-10T13:17:23.995369Z ERROR yazi_scheduler::preload::preload: Preload task `image` returned 2
    at yazi-scheduler/src/preload/preload.rs:42

  2024-04-10T13:17:27.733784Z  WARN yazi_adaptor::emulator: [Adaptor] No special environment variables detected
    at yazi-adaptor/src/emulator.rs:64

  2024-04-10T13:17:27.733808Z  WARN yazi_adaptor::emulator: [Adaptor] Unknown TERM_PROGRAM: 
    at yazi-adaptor/src/emulator.rs:77

  2024-04-10T13:17:27.733810Z  WARN yazi_adaptor::emulator: [Adaptor] Unknown TERM: st-256color
    at yazi-adaptor/src/emulator.rs:84

  2024-04-10T13:17:34.985808Z  WARN yazi_adaptor::emulator: [Adaptor] No special environment variables detected
    at yazi-adaptor/src/emulator.rs:64
sxyazi commented 5 months ago

But when I close the terminal without exiting yazi before and then reopen yazi in a new terminal the preview is messed up

You mean you directly killed the parent process (terminal) of Yazi right? If so, Yazi would also be killed, without having the chance to properly clean up the ueberzugpp process it created, which could lead to issues with ueberzugpp.

Just to double-check, if you exit Yazi normally (by pressing q), does this issue still occur?

BennyOe commented 5 months ago

Yes, exactly. So when I kill the parent process the bug occurs and when I'm quitting yazi properly everything works as expected the next time I open it

sxyazi commented 5 months ago

When you exit the terminal to end Yazi, is the ueberzugpp process still running? What if it ends like this in other terminals? Is the ueberzugpp process still running?

Also, could you try the latest code of Yazi to see if this issue still?

BennyOe commented 5 months ago

No, when I kill the terminal the ueberzugpp process is gone too. I didn't try it with other terminals yet but will later and report. Also I will try with the latest code and report later. Thanks for investigating with me and for this awesome piece of software :)

BennyOe commented 5 months ago

I have to correct myself. This bug is not happening when the terminal gets killed when yazi is open. Instead it happens after every terminal window is closed when yazi was launched before. This also happens on xTerm.

So as long as one terminal window stays open after yazi was first launched, I can do whatever I want and everything is working. But as soon as I kill all terminal windows the bug occures.

sxyazi commented 5 months ago

Please follow this https://yazi-rs.github.io/docs/image-preview#why-cant-i-preview-images-via-%C3%BCberzug to see if this is a problem with Überzug++ itself

BennyOe commented 5 months ago

Unfortunately this works as expected. Also when I kill all terminals and test again, Überzug is showing the images correctly. Also in the Überzug logs everything seems to be ok.

sxyazi commented 5 months ago

Hi, I've created a PR that includes some debug code, https://github.com/sxyazi/yazi/pull/895. Please build it in debug mode (cargo build without --release flag) and repeat the same steps then paste the contents of yazi --debug, ~/.local/state/yazi/yazi.log, and /tmp/ueberzugpp-$USER.log here.

BennyOe commented 5 months ago

yazi --debug

``` Yazi Version: 0.2.4 (13c8120 2024-04-11) OS: linux-x86_64 (unix) Debug: true Emulator Emulator.via_env: ("st-256color", "") Emulator.via_csi: Ok(Unknown([])) Emulator.detect: Unknown([]) Adaptor Adaptor.matches: X11 Desktop XDG_SESSION_TYPE: Some("x11") WAYLAND_DISPLAY: None DISPLAY: Some(":0") SSH shared.in_ssh_connection: false WSL /proc/sys/fs/binfmt_misc/WSLInterop: false Variables SHELL: Some("/usr/bin/zsh") EDITOR: Some("nvim") ZELLIJ_SESSION_NAME: None YAZI_FILE_ONE: None YAZI_CONFIG_HOME: None file(1) Version: Ok(Output { status: ExitStatus(unix_wait_status(0)), stdout: "file-5.45\nmagic file from /usr/share/file/misc/magic\nseccomp support included\n", stderr: "" }) 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 Ueberzug++ Version: Ok(Output { status: ExitStatus(unix_wait_status(0)), stdout: "ueberzugpp 2.9.4\n", stderr: "" }) ```

yazi logs

``` 2024-04-11T07:16:16.093994Z  WARN yazi_adaptor::emulator: [Adaptor] No special environment variables detected at yazi-adaptor/src/emulator.rs:66 2024-04-11T07:16:16.094146Z  WARN yazi_adaptor::emulator: [Adaptor] Unknown TERM_PROGRAM:  at yazi-adaptor/src/emulator.rs:80 2024-04-11T07:16:16.094157Z  WARN yazi_adaptor::emulator: [Adaptor] Unknown TERM: st-256color at yazi-adaptor/src/emulator.rs:87 2024-04-11T07:16:18.101049Z DEBUG yazi_adaptor::ueberzug: ueberzugpp rect before adjustment: Rect { x: 344, y: 2, width: 203, height: 88 } at yazi-adaptor/src/ueberzug.rs:103 2024-04-11T07:16:18.101165Z DEBUG yazi_adaptor::ueberzug: ueberzugpp rect after adjustment: Rect { x: 344, y: 2, width: 203, height: 88 } at yazi-adaptor/src/ueberzug.rs:105 2024-04-11T07:16:18.101189Z DEBUG yazi_adaptor::ueberzug: ueberzugpp command: {"action":"add","identifier":"yazi","x":344,"y":2,"max_width":203,"max_height":88,"path":"/tmp/yazi/5a6f49b8dede08f609377205e119afd6"}  at yazi-adaptor/src/ueberzug.rs:116 2024-04-11T07:16:26.249833Z  WARN yazi_adaptor::emulator: [Adaptor] No special environment variables detected at yazi-adaptor/src/emulator.rs:66 2024-04-11T07:16:26.249904Z  WARN yazi_adaptor::emulator: [Adaptor] Unknown TERM_PROGRAM:  at yazi-adaptor/src/emulator.rs:80 2024-04-11T07:16:26.249917Z  WARN yazi_adaptor::emulator: [Adaptor] Unknown TERM: st-256color at yazi-adaptor/src/emulator.rs:87 2024-04-11T07:16:27.502515Z DEBUG yazi_adaptor::ueberzug: ueberzugpp rect before adjustment: Rect { x: 344, y: 2, width: 203, height: 88 } at yazi-adaptor/src/ueberzug.rs:103 2024-04-11T07:16:27.502675Z DEBUG yazi_adaptor::ueberzug: ueberzugpp rect after adjustment: Rect { x: 344, y: 2, width: 203, height: 88 } at yazi-adaptor/src/ueberzug.rs:105 2024-04-11T07:16:27.502714Z DEBUG yazi_adaptor::ueberzug: ueberzugpp command: {"action":"add","identifier":"yazi","x":344,"y":2,"max_width":203,"max_height":88,"path":"/tmp/yazi/5a6f49b8dede08f609377205e119afd6"}  at yazi-adaptor/src/ueberzug.rs:116 2024-04-11T07:16:40.744972Z  WARN yazi_adaptor::emulator: [Adaptor] No special environment variables detected at yazi-adaptor/src/emulator.rs:66 2024-04-11T07:16:40.745028Z  WARN yazi_adaptor::emulator: [Adaptor] Unknown TERM_PROGRAM:  at yazi-adaptor/src/emulator.rs:80 2024-04-11T07:16:40.745038Z  WARN yazi_adaptor::emulator: [Adaptor] Unknown TERM: st-256color at yazi-adaptor/src/emulator.rs:87 2024-04-11T07:16:40.746453Z  WARN yazi_adaptor::emulator: [Adaptor] No special environment variables detected at yazi-adaptor/src/emulator.rs:66 2024-04-11T07:16:40.746475Z  WARN yazi_adaptor::emulator: [Adaptor] Unknown TERM_PROGRAM:  at yazi-adaptor/src/emulator.rs:80 2024-04-11T07:16:40.746482Z  WARN yazi_adaptor::emulator: [Adaptor] Unknown TERM: st-256color at yazi-adaptor/src/emulator.rs:87 2024-04-11T07:16:40.746607Z  WARN yazi_adaptor::emulator: [Adaptor] No special environment variables detected at yazi-adaptor/src/emulator.rs:66 2024-04-11T07:16:40.746624Z  WARN yazi_adaptor::emulator: [Adaptor] Unknown TERM_PROGRAM:  at yazi-adaptor/src/emulator.rs:80 2024-04-11T07:16:40.746630Z  WARN yazi_adaptor::emulator: [Adaptor] Unknown TERM: st-256color at yazi-adaptor/src/emulator.rs:87 2024-04-11T07:19:45.245461Z  WARN yazi_adaptor::emulator: [Adaptor] No special environment variables detected at yazi-adaptor/src/emulator.rs:66 2024-04-11T07:19:45.245522Z  WARN yazi_adaptor::emulator: [Adaptor] Unknown TERM_PROGRAM:  at yazi-adaptor/src/emulator.rs:80 2024-04-11T07:19:45.245532Z  WARN yazi_adaptor::emulator: [Adaptor] Unknown TERM: st-256color at yazi-adaptor/src/emulator.rs:87 2024-04-11T07:19:48.021889Z DEBUG yazi_adaptor::ueberzug: ueberzugpp rect before adjustment: Rect { x: 77, y: 2, width: 43, height: 87 } at yazi-adaptor/src/ueberzug.rs:103 2024-04-11T07:19:48.022037Z DEBUG yazi_adaptor::ueberzug: ueberzugpp rect after adjustment: Rect { x: 77, y: 2, width: 43, height: 87 } at yazi-adaptor/src/ueberzug.rs:105 2024-04-11T07:19:48.022124Z DEBUG yazi_adaptor::ueberzug: ueberzugpp command: {"action":"add","identifier":"yazi","x":77,"y":2,"max_width":43,"max_height":87,"path":"/tmp/yazi/5a6f49b8dede08f609377205e119afd6"}  at yazi-adaptor/src/ueberzug.rs:116 ```

Ueberzug log

``` _ _ _ | | | | | | _ _ | | | | ___| |__ ___ _ __ _____ _ __ _ _| |_ _| |_ | | | |/ _ \ '_ \ / _ \ '__|_ / | | |/ _` |_ _|_ _| | |_| | __/ |_) | __/ | / /| |_| | (_| | |_| |_| \___/ \___|_.__/ \___|_| /___|\__,_|\__, | __/ | |___/ v2.9.4 [2024-04-11 09:16:16.256] [terminal] [info] TERM = st-256color [2024-04-11 09:16:16.256] [terminal] [info] PTY = /dev/pts/0 [2024-04-11 09:16:16.256] [terminal] [debug] ioctl sizes: COLS=548 ROWS=92 XPIXEL=3836 YPIXEL=1564 [2024-04-11 09:16:16.256] [terminal] [debug] iterm2 is not supported [2024-04-11 09:16:16.256] [terminal] [debug] X11 is supported [2024-04-11 09:16:16.256] [terminal] [debug] Using fallback X11 window id 14680070 [2024-04-11 09:16:16.256] [terminal] [debug] X11 sizes: XPIXEL=3840 YPIXEL=1575 [2024-04-11 09:16:16.256] [terminal] [debug] Wayland is not supported [2024-04-11 09:16:16.256] [terminal] [debug] padding_horiz=2 padding_vert=5 [2024-04-11 09:16:16.256] [terminal] [debug] font_width=7 font_height=17 [2024-04-11 09:16:16.256] [X11] [info] Canvas created [2024-04-11 09:16:16.257] [main] [info] Listening for commands on socket /tmp/ueberzugpp-2352.socket [2024-04-11 09:16:18.101] [main] [info] Command received: {"action":"add","identifier":"yazi","max_height":88,"max_width":203,"path":"/tmp/yazi/5a6f49b8dede08f609377205e119afd6","x":344,"y":2} [2024-04-11 09:16:18.123] [opencv] [info] loading file /tmp/yazi/5a6f49b8dede08f609377205e119afd6 [2024-04-11 09:16:18.124] [opencv] [debug] Resizing image [2024-04-11 09:16:18.151] [X11] [debug] Initializing canvas [2024-04-11 09:16:18.151] [X11] [debug] Created child window 35651584 at (2410,39) with parent 14680070 [2024-04-11 09:16:18.151] [X11] [debug] Received expose event for window 35651584 [2024-04-11 09:16:18.155] [X11] [debug] Received expose event for window 35651584 [2024-04-11 09:16:20.563] [main] [info] Exiting ueberzugpp _ _ _ | | | | | | _ _ | | | | ___| |__ ___ _ __ _____ _ __ _ _| |_ _| |_ | | | |/ _ \ '_ \ / _ \ '__|_ / | | |/ _` |_ _|_ _| | |_| | __/ |_) | __/ | / /| |_| | (_| | |_| |_| \___/ \___|_.__/ \___|_| /___|\__,_|\__, | __/ | |___/ v2.9.4 [2024-04-11 09:16:26.310] [terminal] [info] TERM = st-256color [2024-04-11 09:16:26.310] [terminal] [info] PTY = /dev/pts/0 [2024-04-11 09:16:26.310] [terminal] [debug] ioctl sizes: COLS=0 ROWS=0 XPIXEL=0 YPIXEL=0 [2024-04-11 09:16:26.310] [terminal] [debug] iterm2 is not supported [2024-04-11 09:16:26.310] [terminal] [debug] X11 is supported [2024-04-11 09:16:26.310] [terminal] [debug] Using fallback X11 window id 14680070 [2024-04-11 09:16:26.310] [terminal] [debug] X11 sizes: XPIXEL=3840 YPIXEL=1575 [2024-04-11 09:16:26.310] [terminal] [debug] Wayland is not supported [2024-04-11 09:16:26.310] [terminal] [debug] padding_horiz=0 padding_vert=0 [2024-04-11 09:16:26.310] [terminal] [debug] font_width=0 font_height=0 [2024-04-11 09:16:26.310] [X11] [info] Canvas created [2024-04-11 09:16:26.311] [main] [info] Listening for commands on socket /tmp/ueberzugpp-2854.socket [2024-04-11 09:16:27.502] [main] [info] Command received: {"action":"add","identifier":"yazi","max_height":88,"max_width":203,"path":"/tmp/yazi/5a6f49b8dede08f609377205e119afd6","x":344,"y":2} [2024-04-11 09:16:27.527] [opencv] [info] loading file /tmp/yazi/5a6f49b8dede08f609377205e119afd6 [2024-04-11 09:16:27.543] [X11] [debug] Initializing canvas [2024-04-11 09:16:27.543] [X11] [debug] Created child window 35651584 at (0,0) with parent 14680070 [2024-04-11 09:16:27.544] [X11] [debug] Received expose event for window 35651584 [2024-04-11 09:16:27.548] [X11] [debug] Received expose event for window 35651584 [2024-04-11 09:16:36.825] [main] [info] Exiting ueberzugpp _ _ _ | | | | | | _ _ | | | | ___| |__ ___ _ __ _____ _ __ _ _| |_ _| |_ | | | |/ _ \ '_ \ / _ \ '__|_ / | | |/ _` |_ _|_ _| | |_| | __/ |_) | __/ | / /| |_| | (_| | |_| |_| \___/ \___|_.__/ \___|_| /___|\__,_|\__, | __/ | |___/ v2.9.4 [2024-04-11 09:16:40.802] [terminal] [info] TERM = st-256color [2024-04-11 09:16:40.802] [terminal] [info] PTY = /dev/pts/0 [2024-04-11 09:16:40.802] [terminal] [debug] ioctl sizes: COLS=0 ROWS=0 XPIXEL=0 YPIXEL=0 [2024-04-11 09:16:40.802] [terminal] [debug] iterm2 is not supported [2024-04-11 09:16:40.802] [terminal] [debug] X11 is supported [2024-04-11 09:16:40.802] [terminal] [debug] Using fallback X11 window id 14680070 [2024-04-11 09:16:40.802] [terminal] [debug] X11 sizes: XPIXEL=3840 YPIXEL=1575 [2024-04-11 09:16:40.802] [terminal] [debug] Wayland is not supported [2024-04-11 09:16:40.802] [terminal] [debug] padding_horiz=0 padding_vert=0 [2024-04-11 09:16:40.802] [terminal] [debug] font_width=0 font_height=0 [2024-04-11 09:16:40.803] [X11] [info] Canvas created [2024-04-11 09:16:40.803] [main] [info] Listening for commands on socket /tmp/ueberzugpp-2977.socket [2024-04-11 09:16:40.903] [main] [info] Exiting ueberzugpp _ _ _ | | | | | | _ _ | | | | ___| |__ ___ _ __ _____ _ __ _ _| |_ _| |_ | | | |/ _ \ '_ \ / _ \ '__|_ / | | |/ _` |_ _|_ _| | |_| | __/ |_) | __/ | / /| |_| | (_| | |_| |_| \___/ \___|_.__/ \___|_| /___|\__,_|\__, | __/ | |___/ v2.9.4 [2024-04-11 09:19:45.315] [terminal] [info] TERM = st-256color [2024-04-11 09:19:45.315] [terminal] [info] PTY = /dev/pts/0 [2024-04-11 09:19:45.315] [terminal] [debug] ioctl sizes: COLS=0 ROWS=0 XPIXEL=0 YPIXEL=0 [2024-04-11 09:19:45.315] [terminal] [debug] iterm2 is not supported [2024-04-11 09:19:45.316] [terminal] [debug] X11 is supported [2024-04-11 09:19:45.316] [terminal] [debug] Using fallback X11 window id 50331654 [2024-04-11 09:19:45.316] [terminal] [debug] X11 sizes: XPIXEL=853 YPIXEL=1553 [2024-04-11 09:19:45.316] [terminal] [debug] Wayland is not supported [2024-04-11 09:19:45.316] [terminal] [debug] padding_horiz=0 padding_vert=0 [2024-04-11 09:19:45.316] [terminal] [debug] font_width=0 font_height=0 [2024-04-11 09:19:45.316] [X11] [info] Canvas created [2024-04-11 09:19:45.316] [main] [info] Listening for commands on socket /tmp/ueberzugpp-4945.socket [2024-04-11 09:19:48.022] [main] [info] Command received: {"action":"add","identifier":"yazi","max_height":87,"max_width":43,"path":"/tmp/yazi/5a6f49b8dede08f609377205e119afd6","x":77,"y":2} [2024-04-11 09:19:48.048] [opencv] [info] loading file /tmp/yazi/5a6f49b8dede08f609377205e119afd6 [2024-04-11 09:19:48.063] [X11] [debug] Initializing canvas [2024-04-11 09:19:48.063] [X11] [debug] Created child window 52428800 at (0,0) with parent 50331654 [2024-04-11 09:19:48.063] [X11] [debug] Received expose event for window 52428800 [2024-04-11 09:19:48.067] [X11] [debug] Received expose event for window 52428800 [2024-04-11 09:19:49.422] [main] [info] Exiting ueberzugpp _ _ _ | | | | | | _ _ | | | | ___| |__ ___ _ __ _____ _ __ _ _| |_ _| |_ | | | |/ _ \ '_ \ / _ \ '__|_ / | | |/ _` |_ _|_ _| | |_| | __/ |_) | __/ | / /| |_| | (_| | |_| |_| \___/ \___|_.__/ \___|_| /___|\__,_|\__, | __/ | |___/ v2.9.4 [2024-04-11 09:21:37.990] [terminal] [info] TERM = st-256color [2024-04-11 09:21:37.991] [terminal] [info] PTY = /dev/pts/0 [2024-04-11 09:21:38.003] [X11] [info] Canvas created [2024-04-11 09:21:38.003] [main] [info] Listening for commands on socket /tmp/ueberzugpp-5693.socket ```

Some additiional information I found. The bug occurs when you kill the first terminal window. You don't even had to run yazi in it. So all is working until you close the first opened terminal window after a reboot. It doesn't matter if this terminal is st or xTerm.

sxyazi commented 5 months ago

From the log, Yazi sent the correct commands to ueberzugpp, but only the position of the first created subwindow is correct:

[2024-04-11 09:16:18.101] [main] [info] Command received: {"action":"add","identifier":"yazi","max_height":88,"max_width":203,"path":"/tmp/yazi/5a6f49b8dede08f609377205e119afd6","x":344,"y":2}
[2024-04-11 09:16:18.151] [X11] [debug] Created child window 35651584 at (2410,39) with parent 14680070

And the positions of the subsequent ones are (0,0):

[2024-04-11 09:16:27.502] [main] [info] Command received: {"action":"add","identifier":"yazi","max_height":88,"max_width":203,"path":"/tmp/yazi/5a6f49b8dede08f609377205e119afd6","x":344,"y":2}
[2024-04-11 09:16:27.543] [X11] [debug] Created child window 35651584 at (0,0) with parent 14680070

So I think this is a bug in ueberzugpp, maybe @jstkdng can provide some input.

sxyazi commented 5 months ago

It might be related to https://github.com/jstkdng/ueberzugpp/issues/170.

Hi @BennyOe, could you try rolling back ueberzugpp to a version before 2.9.4 to see if it works? As I noticed your ueberzugpp version is also 2.9.4.

BennyOe commented 5 months ago

Downgrading ueberzugpp to 2.8.8 worked! :+1: Thanks so much for the help!

jstkdng commented 5 months ago

It's a shame that OP never answered my further inquiries on the other issue. I'll see what I can do. Could be an issue with ST as everything is working fine on my end. @BennyOe can you post your ST patches/config?

Ornanovitch commented 4 months ago

I had a similar problem yesterday, after having updated ueberzugpp from 2.9.4-1 to 2.9.4-2 on Archlinux (but this bump of the pkgrel has only been triggered to fix some out of date/missing libraries, I don't know which ones).

It's working again since a reboot, but I still managed to identify a potential problem similar to what I observed yesterday: with Yazi I navigated into a folder with hundreds of images. While everything looked ok on the ui side, a generation process seemed blocked:

2024-05-11-131455_209x41_scrot

When I tried to quit properly Yazi, it warned me:

1 task running, sure to quit?

In the meantime, here was the unfinished job from the ueberzugpp log:

[2024-05-11 13:07:12.939] [opencv] [info] loading file /tmp/yazi/5b580669acab7d41a304b978b4138b2a
[2024-05-11 13:07:14.583] [main] [info] Command received: {"action":"remove","identifier":"yazi"}
# nothing else after

But when I forced quit and re-opened Yazi, everything was still working, so maybe I had no luck yesterday...

sxyazi commented 4 months ago

Hey @Ornanovitch, this might be due to the failure of image preloading, which is unrelated to the reported Überzug++ bug, since Überzug++ is not handled by the task scheduling system of Yazi, it won't cause the progress bar to appear.

If the issue occurs again, press w to open the task manager, then hover on the task and press <Enter> to inspect it, and copy the error information to file a new issue.

github-actions[bot] commented 3 months ago

I'm going to lock this issue because it has been closed for 30 days. ⏳ This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.