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

Support sixels in conhost / openconsole #1615

Open
2 of 3 tasks
johnd0e opened this issue Sep 5, 2024 · 5 comments
Open
2 of 3 tasks

Support sixels in conhost / openconsole #1615

johnd0e opened this issue Sep 5, 2024 · 5 comments
Labels
feature New feature request

Comments

@johnd0e
Copy link

johnd0e commented Sep 5, 2024

yazi --debug output

Yazi
    Version: 0.3.3 (7c445ce 2024-09-04)
    Debug  : false
    OS     : windows-x86_64 (windows)

Ya
    Version: 0.3.3 (7c445ce 2024-09-04)

Emulator
    Emulator.via_env: ("", "")
    Emulator.via_csi: Ok(Unknown([Sixel]))
    Emulator.detect : Unknown([Sixel])

Adapter
    Adapter.matches: Chafa

Desktop
    XDG_SESSION_TYPE           : None
    WAYLAND_DISPLAY            : None
    DISPLAY                    : None
    SWAYSOCK                   : None
    HYPRLAND_INSTANCE_SIGNATURE: None
    WAYFIRE_SOCKET             : None

SSH
    shared.in_ssh_connection: false

WSL
    WSL: false

Variables
    SHELL              : None
    EDITOR             : None
    VISUAL             : None
    YAZI_FILE_ONE      : Some("C:\\Program Files\\Git\\usr\\bin\\file.exe")
    YAZI_CONFIG_HOME   : None

Text Opener
    default: Some(Opener { run: "code %*", block: false, orphan: true, desc: "code", for_: None, spread: true })
    block  : Some(Opener { run: "code -w %*", block: true, orphan: false, desc: "code (block)", for_: None, spread: true })

Multiplexers
    TMUX               : false
    tmux version       : program not found
    ZELLIJ_SESSION_NAME: None
    Zellij version     : program not found

Dependencies
    file             : 5.45
    ueberzugpp       : program not found
    ffmpegthumbnailer: program not found
    magick           : program not found
    fzf              : 0.42.0
    fd               : 8.7.0
    rg               : program not found
    chafa            : 1.15.0
    zoxide           : program not found
    7z               : program not found
    7zz              : program not found
    jq               : 1.7


--------------------------------------------------
When reporting a bug, please also upload the `yazi.log` log file - only upload the most recent content by time.
You can find it in the "C:\\Users\\anton\\AppData\\Roaming\\yazi\\state" directory.

Please describe the problem you're trying to solve

With latest wt canary (1.23.2481.0) sixels output works ok, but only when launching yazi in WT.

I would like use it via openconsole.exe instead, and it should be possible - see debug output.

Would you be willing to contribute this feature?

  • Yes, I'll give it a shot

Describe the solution you'd like

The difference in debug output between WT and openconsole:

--- wt
+++ openconsole
@@ -10,10 +10,10 @@
 Emulator
     Emulator.via_env: ("", "")
     Emulator.via_csi: Ok(Unknown([Sixel]))
-    Emulator.detect : Microsoft
+    Emulator.detect : Unknown([Sixel])

 Adapter
-    Adapter.matches: Sixel
+    Adapter.matches: Chafa

 Desktop
     XDG_SESSION_TYPE           : None

Additional context

Yazi 0.3.3 (7c445ce 2024-09-04)

Validations

  • I have searched the existing issues
  • The latest nightly build of Yazi doesn't already have this feature
@johnd0e johnd0e added the feature New feature request label Sep 5, 2024
@sxyazi
Copy link
Owner

sxyazi commented Sep 5, 2024

This is a bit tricky. For the older ConPTY (used by WezTerm and Mintty), we need to filter out Sixel and use IIP because ConPTY interferes with and breaks Sixel. But for the new ConPTY, we'll need to avoid filtering it out, and we need to make sure this doesn't affect the existing WezTerm and Mintty users. Any ideas on how to solve this?

@sxyazi sxyazi added the waiting on op Waiting for more information from the original poster label Sep 5, 2024
@johnd0e
Copy link
Author

johnd0e commented Sep 5, 2024

Any ideas on how to solve this?

Actually I do not get what is the problem:

  • openconsole: Emulator.via_csi: Ok(Unknown([Sixel]))
  • wezterm: Emulator.via_csi: Ok(Unknown([]))

@github-actions github-actions bot removed the waiting on op Waiting for more information from the original poster label Sep 5, 2024
@sxyazi
Copy link
Owner

sxyazi commented Sep 5, 2024

Hmm that's weird, it should be recognized as WezTerm instead of Unknown. I'll test it tomorrow, maybe related to #1611

@johnd0e
Copy link
Author

johnd0e commented Sep 5, 2024

it should be recognized as WezTerm instead of Unknown.

Actually it is only Emulator.via_csi, the other properties are ok:

Emulator
    Emulator.via_env: ("xterm-256color", "WezTerm")
    Emulator.via_csi: Ok(Unknown([]))
    Emulator.detect : WezTerm

Adapter
    Adapter.matches: Iterm2

@e82eric
Copy link
Contributor

e82eric commented Sep 6, 2024

@sxyazi it might make sense for Windows to use the parent process name to figure out if it is conhost or windows terminal. That was the only way that I could think of to discover Conhost. (After that is seems to be able to use the da1 logic to detect sixel, it just has to know that it microsoft to get passed this check:

protocols.retain(|p| *p == Self::Iterm2);
)

I did a quick POC and it seemed to work. (Let me know if makes sense to create a PR for this).
57b2780

conhost-sixel

Looking at the debug output I am wondering if I had a bug in #1588 where the Emulator.via_csi is correct but the Adapter.matches is incorrect for the pre-1.22 windows terminal.

1.22 Conhost
1 22-conhost

1.22 Windows Terminal
1 22-wt

Wezterm
wezterm-yazi

pre-1.22 Conhost
pre-1 22-conhost

pre-1.22 Windows Terminal
pre-1 22-wt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature request
Projects
None yet
Development

No branches or pull requests

3 participants