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

Image preview in WezTerm over SSH on Windows #505

Open
blumenschwein opened this issue Feb 16, 2022 · 7 comments
Open

Image preview in WezTerm over SSH on Windows #505

blumenschwein opened this issue Feb 16, 2022 · 7 comments
Labels
bug Something isn't working windows Windows specific problem

Comments

@blumenschwein
Copy link

blumenschwein commented Feb 16, 2022

High-resolution image preview (kitty graphics protocol) in broot does not work, when logging from a Windows computer to an Ubuntu computer using WezTerm and SSH.

Settings

  • Computer A: running Windows, WezTerm version 20220213-203140-4a1c4b55
  • Computer B and C: running Ubuntu 20.04, WezTerm version 20220213-203140-4a1c4b55, broot version 1.9.3

What works

When accessing B from C using SSH and WezTerm (TERM_PROGRAM=WezTerm and TERM_PROGRAM_VERSION=20220213-203140-4a1c4b55 are exported accordingly), image preview works in broot. The resolution of the preview is high.

What does not work

When accessing B or C from A using SSH and WezTerm without exporting TERM_PROGRAM and TERM_PROGRAM_VERSION, broot shows low-resolution image previews. After exporting TERM_PROGRAM=WezTerm and TERM_PROGRAM_VERSION=20220213-203140-4a1c4b55, broot does not show any image preview (the preview region is black). The command wezterm imgcat shows high-resolution preview.

@blumenschwein blumenschwein added the bug Something isn't working label Feb 16, 2022
@wez
Copy link

wez commented Feb 17, 2022

if you are using the standalone ssh executable then you are most likely running into a limitation of the conpty layer where it doesn't understand the iterm or kitty image protocols.

You may wish to try using wezterm ssh B to connect to B using wezterm's integrated ssh client; that doesn't need to use conpty and should work with both kitty and iterm image protocols.

@Canop
Copy link
Owner

Canop commented Feb 17, 2022

@blumenschwein If you can confirm what @wez said, I'll add an entry in the FAQ

@blumenschwein
Copy link
Author

blumenschwein commented Feb 17, 2022

Thanks @wez @Canop . I have made more tests, but unfortunately, using wezterm ssh alone does not seem to change much.

Test 1

Now I tried wezterm ssh B and adapted the AcceptEnv settings in /etc/ssh/sshd_config on B accordingly, so that variables TERM_PROGRAM etc. are set automatically at login. But this does not change much. Instead of showing a black region, now broot shows previews in low resolution.

There are some warnings regarding OpenGL:

>wezterm ssh user_name@computer_B

2022-02-17T11:09:10.121Z WARN  window::os::windows::window > EGL init failed Config says to avoid EGL, fall back to WGL
2022-02-17T11:09:10.270Z INFO  wezterm_gui::termwindow     > OpenGL initialized! Intel(R) UHD Graphics 4.5.0 - Build 26.20.100.7870 is_context_loss_possible=true wezterm version: 20220213-203140-4a1c4b55
2022-02-17T11:09:38.502Z WARN  wezterm_term::terminalstate > unhandled DecPrivateMode SetDecPrivateMode(Unspecified(1015))

Besides, the command wezterm imgcat always shows high-resolution previews, both with standalone ssh and with wezterm ssh. I got low-resolution previews or black region only when using broot.

Test 2

I also installed WSL2 on A and used the Linux version of WezTerm from there to accessed B. It works with standalone ssh and exporting TERM_PROGRAM etc. manually, and broot shows high-resolution previews in this case. But just like in Test 1, with wezterm ssh broot shows only low-resolution previews. Also here, the command wezterm imgcat always shows high-resolution previews, both for standalone ssh and wezterm ssh.

@Canop Canop added the windows Windows specific problem label Apr 16, 2022
@AeliusSaionji
Copy link

This is probably a duplicate of #509
Unless OP can attest otherwise, broot's high res image preview does not work under Windows at all, and it's not related to ssh.

@i-api
Copy link

i-api commented Jul 19, 2024

Am also using wezterm, but on Mac. Image preview with broot over ssh is low quality.

But I can confirm if you export these variables (in your ssh session), high quality image preview will work with broot:

    export TERM_PROGRAM="WezTerm"
    export TERM_PROGRAM_VERSION="20240203-110809-5046fc22"

@AeliusSaionji
Copy link

huh!

Image preview over ssh is working on Windows for me, thanks for prompting me to try setting the variables on the remote host.

So I guess this issue is resolved.

Unfortunately I still cannot get broot to show previews in hq for Windows locally.

@i-api
Copy link

i-api commented Jul 21, 2024

Am also using wezterm, but on Mac. Image preview with broot over ssh is low quality.

But I can confirm if you export these variables (in your ssh session), high quality image preview will work with broot:

    export TERM_PROGRAM="WezTerm"
    export TERM_PROGRAM_VERSION="20240203-110809-5046fc22"

I opened up a new issue - broot 1.34+ breaks the high quality image preview, but broot version 1.33 works fine: #910

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

No branches or pull requests

5 participants