Skip to content

[BUG REPORT] The right column does not follow a shell started with wsl.exe #3

Closed

Description

@zbn297427669

Where

Windows

What happened

With Shell set to wsl (Settings › Terminal › Shell), a session starts in WSL, but the right column never follows it: it stays on the folder the session started in, the user's home folder (dirs::home_dir(), src/main.rs:24), however much one cds inside the distribution. Files and Git are both dead for that session. The screenshot shows uname -r and pwd in WSL, the tree still rooted at the home folder, and the caption below the Git/Files switch.

Reading v0.1.7 (fe07813), two separate things stop it:

  1. term::shell::launch picks the integration by the executable's file stem (src/term/shell.rs:83-86) and matches only zsh, bash, fish, pwsh and powershell (src/term/shell.rs:99-144). wsl takes the _ arm, which sets reports = false (src/term/shell.rs:140-143), so no script is injected and nothing in the session ever sends OSC 7. The column says so, in the caption "This shell reports no folder." (src/workspace.rs:427-431). The match reads only the stem, so wsl -d Ubuntu and wsl --cd ~ go the same way.

  2. A WSL shell that sends OSC 7 of its own (starship, powerlevel10k and others do) is dropped too. term::tap::folder takes a file://host/path only when the host is empty, localhost, or gethostname() (src/term/tap.rs:362-372). The binary runs on Windows, so gethostname() is the Windows name, and WSL rewrites the hostname — on this machine XM_Stable under Windows against XMStable in Ubuntu 24.04 — so eq_ignore_ascii_case never matches and the folder is discarded. As far as I can tell that check can never pass for a WSL shell on Windows.

Steps to reproduce

  1. Settings › Terminal › Shell: wsl
  2. New session, then cd ~ or cd / inside the distribution
  3. The right column still shows the user's home folder; the Files tree does not move, and no Git state for the folder appears

What I expected

The right column follows the folder the session reports. I understand a shell with no integration is left alone on purpose (reports = false, "Fail fast"), so this may be intended rather than a defect — if so, please read it as a request for WSL support on Windows, which is where I hit it.

Commit or version

v0.1.7, fe07813

Logs

No output was captured; elyterminal.exe from the release zip is a GUI-subsystem binary, so it has no console. The caption "This shell reports no folder." is the same signal, and it is what the screenshot shows.


Two directions, if you want them (yours to judge; I have tried neither)

  • Inject into WSL. The scripts already sit where the distribution can read them — %LOCALAPPDATA%\ELYTerminal\shell-integration, which WSL sees under its mount root — so a wsl launch could name the script by its /mnt/... path the way the other shells do: --rcfile for bash, ZDOTDIR for zsh, XDG_DATA_DIRS for fish, -Command for pwsh. The mount root is not always /mnt/c, so it needs reading per distribution.
  • Let the OSC 7 host check pass on WSL: compare against gethostname() with the characters a hostname cannot hold taken out (the _ in XM_Stable), which is what WSL does to build its own.

Activity

  1. zbn297427669 commented on Oct 20, 2026

    @zbn297427669
    Author
    Image
  2. Raiden-MeixElysia commented on Oct 21, 2026

    @Raiden-MeixElysia
    Contributor

    Thank, Will investigate this issue

  3. Raiden-MeixElysia commented on Oct 22, 2026

    @Raiden-MeixElysia
    Contributor

    Thanks for the careful report! Fixed in v0.1.8: with Shell set to wsl, Files and Git now follow the session. https://github.com/ELY-Open-Source/ELYTerminal/releases/tag/v0.1.8

  4. added a commit that references this issue on Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions