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

Windows Terminal (Arch in WSL) mistaken for WezTerm #1611

Open
MarvinJWendt opened this issue Sep 4, 2024 · 2 comments
Open

Windows Terminal (Arch in WSL) mistaken for WezTerm #1611

MarvinJWendt opened this issue Sep 4, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@MarvinJWendt
Copy link

MarvinJWendt commented Sep 4, 2024

What system are you running Yazi on?

Windows WSL

What terminal are you running Yazi in?

Windows Terminal

yazi --debug output

Yazi
    Version: 0.3.2 (Arch Linux 2024-08-31)
    Debug  : false
    OS     : linux-x86_64 (unix)

Ya
    Version: 0.3.2 (Arch Linux 2024-08-31)

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

Adapter
    Adapter.matches: Wayland

Desktop
    XDG_SESSION_TYPE: None
    WAYLAND_DISPLAY : Some("wayland-0")
    DISPLAY         : Some(":0")

SSH
    shared.in_ssh_connection: false

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

Variables
    SHELL              : Some("/bin/zsh")
    EDITOR             : Some("nvim")
    VISUAL             : None
    YAZI_FILE_ONE      : None
    YAZI_CONFIG_HOME   : 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 })

Multiplexers
    TMUX               : false
    tmux version       : 3.4
    ZELLIJ_SESSION_NAME: None
    Zellij version     : 0.40.1

Dependencies
    file             : 5.45
    ueberzugpp       : No such file or directory (os error 2)
    ffmpegthumbnailer: 2.2.2
    magick           : 7.1.1-38
    fzf              : 0.54.3
    fd               : 10.2.0
    rg               : 14.1.0
    chafa            : 1.15.0
    zoxide           : 0.9.4
    7z               : 17.05
    7zz              : No such file or directory (os error 2)
    jq               : 1.7.1


--------------------------------------------------
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 "/home/main/.local/state/yazi" directory.

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

No, and I'll explain why below

Describe the bug

Bug discovered in discussion previously. (#1470 (reply in thread))

Yazi is mistaking the Windows Terminal for WezTerm. Yazi always detects either Wayland or X11, which is not available on my system (Windows Terminal with Arch in WSL). I do have some hacks in place in my WSL to make some tools work. It simulates a display, which sets the DISPLAY env var. There is no Wayland/X11 running, but some of those env variables are set.

Setting DISPLAY env var to empty:
image

Setting WAYLAND_DISPLAY to empty string:
image

Completely unsetting the env variables:

Adapter
    Adapter.matches: KittyOld

Desktop
    XDG_SESSION_TYPE: None
    WAYLAND_DISPLAY : None
    DISPLAY         : None

Minimal reproducer

  1. Windows Terminal with Arch Linux in WSL
  2. Run yazi --debug
  3. Wrong detection

Anything else?

If you do not have access to a WSL instance, I would be happy to test nightlies for you.

@MarvinJWendt MarvinJWendt added the bug Something isn't working label Sep 4, 2024
@e82eric
Copy link
Contributor

e82eric commented Sep 6, 2024

@MarvinJWendt I am wondering if it is getting more than one of the environment variables that it uses to detect the emulator and picking the non Windows Terminal one.

If you look at your environment variables in that shell do you see the WT_Session one? And any others from this list?

let vars = [

@MrDwarf7
Copy link

MrDwarf7 commented Sep 15, 2024

@MarvinJWendt Could you share some further details in terms of what your hack/workarounds are for other applications (Or even what the requirement is, might be a case it can be fully worked around etc.)?
I've got almost the same setup (Using WSL(2) Arch in a Windows via Windows Terminal) and would like to see if I can reproduce this to have a better look into it.

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

3 participants