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

Setting startingDirectory on command line for WSL2 Location Windows 11 Ubuntu 24.04 fails #18162

Open
yorkshire-pudding opened this issue Nov 7, 2024 · 0 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

@yorkshire-pudding
Copy link

yorkshire-pudding commented Nov 7, 2024

Windows Terminal version

1.21.2911.0

Windows build number

10.0.22631.4317

Other Software

Ubuntu 24.04.1 LTS inside WSL2 (2.3.24.0)
GNU bash, version 5.2.21(1)-release (x86_64-pc-linux-gnu)

Steps to reproduce

  1. Create bash script in WSL2 to open a tab at a particular location
#!/bin/bash
# Create tab for Scripts
cmd.exe /c "wt.exe" \
  --window 0 \
  new-tab --title Scripts --suppressApplicationTitle \
  --profile "Ubuntu" \
  --startingDirectory "$HOME/projects/scripts"
  1. Run script

I followed these instructions: https://learn.microsoft.com/en-us/windows/terminal/command-line-arguments?tabs=linux#target-a-directory
which do not give any insight into WSL2 locations. (Note I prefer to use verbose options in scripts for later readability which is why I have --startingDirectory rather than -d)

I also tried:

  • --startingDirectory "~/projects/scripts"
  • --startingDirectory "/home/user/projects/scripts"
  • --startingDirectory '\\wsl$\Ubuntu\home\user\projects\scripts'
  • --startingDirectory "\\\\wsl.localhost\\Ubuntu\\home\\user\\projects\\scripts" - this without the escaped \ is the location I see in Windows Explorer
  • --startingDirectory "\\wsl.localhost\Ubuntu\home\user\projects\scripts" - this fails with error:
    • [error 2147942667 (0x8007010b) when launching 'ubuntu.exe'] Could not access starting directory C:\wsl.localhost\Ubuntu\home\user\projects\scripts"

Expected Behavior

Tab opens at location with title.

This worked in Windows 10 with Ubuntu 20.04 inside WSL2

Actual Behavior

Tab opens at home location (i.e. ~) with title

@yorkshire-pudding yorkshire-pudding 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 Nov 7, 2024
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

1 participant