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

Duplicating tab is *significantly* slower than new tab #18333

Open
jaybosamiya-ms opened this issue Dec 16, 2024 · 3 comments
Open

Duplicating tab is *significantly* slower than new tab #18333

jaybosamiya-ms opened this issue Dec 16, 2024 · 3 comments
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting

Comments

@jaybosamiya-ms
Copy link

Windows Terminal version

1.21.3231.0

Windows build number

10.0.26100.0

Other Software

zsh 5.9 (x86_64-ubuntu-linux-gnu)

Steps to reproduce

  1. Set default profile to Ubuntu (might not be necessary, but I have only tested this on Ubuntu, with zsh as my shell)
  2. Make sure that the PWD tracking is set up
    if test -n "$WT_SESSION"; then
        # See https://learn.microsoft.com/en-us/windows/terminal/tutorials/new-tab-same-directory
        __keep_current_path() { printf "\e]9;9;%s\e\\" "$(wslpath -w "$PWD")" }
        precmd_functions+=(__keep_current_path)
    fi
  3. Open new tab---this is always practically instant
  4. Duplicate the tab---this sometimes takes 30s to even a minute; most of the times, this is roughly as fast as opening a new tab, but other times, it takes a long time (obviously, this is not WSL spin-up time, because WSL it already running, and even opening a new tab works immediately). No clear pattern to when it is going take longer to duplicate a tab though.

Expected Behavior

Duplicating a tab should not be faster than opening a new tab and running cd {prev tab working directory}

Actual Behavior

Duplicating the tab (sometimes) literally takes longer than me re-typing the whole path out by hand.

@jaybosamiya-ms jaybosamiya-ms added Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Dec 16, 2024
@jaybosamiya-ms
Copy link
Author

Do let me know if I can enable some tracing/logging that might help provide more details the next time that I hit upon the slowdown, to help reproduce the issue.

@lhecker
Copy link
Member

lhecker commented Dec 17, 2024

This is one of those times again where https://superluminal.eu/ would be super helpful...

I think as a basic triage you could try and see how fast Windows Terminal launches wsl.exe and OpenConsole.exe, by watching the process tree via https://systeminformer.sourceforge.io/ (or alternatively https://learn.microsoft.com/en-us/sysinternals/downloads/process-explorer). Does it happen instantly? If so, then it's at least quite a bit less likely to be a bug in Windows Terminal.

@zadjii-msft
Copy link
Member

My guess is that passing a path to wsl -cd is what's tripping us up here. I'd bet wsl is evaluating the path slowly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting
Projects
None yet
Development

No branches or pull requests

3 participants