0

I am using the wt.exe CLI to run some WSL commands in a new tab. However, I seem to be getting some weird error when using Fish shell.

The command:

wt.exe --window 0 new-tab -p Ubuntu /usr/bin/fish -C "cd /"

This starts a new tab but it has the following error:

[error 2147942402 (0x80070002) when launching `"cd /"']

I know I can use the -d flag to set the starting directory, but the cd / is just a placeholder command for the example, the actual command would be different.

3
  • Do you have a Windows Terminal profile configured to use the Fish shell? The error is essentially a “file not found” error. Your path wouldn’t exist or be accessible from Windows which is probably the reason the file cannot be found.
    – Ramhound
    Commented Sep 7, 2023 at 11:32
  • Yes I do, I have a Ubuntu profile that has fish as the default shell Commented Sep 11, 2023 at 7:50
  • So provide the formatted json for the profile.
    – Ramhound
    Commented Sep 11, 2023 at 11:30

1 Answer 1

0

I suspect you'll want:

wt.exe --window 0 new-tab -p Ubuntu -- wsl.exe -d Ubuntu /usr/bin/fish -C "cd /"

When you pass -p Ubuntu, that tells the Terminal to use your Ubuntu profile. However, the commandline that follows that doesn't get appended to "Ubuntu"'s commandline, it replaces it. So you need to manually pass the wsl.exe -d Ubuntu from the Ubuntu profile's commandline.


Addendum: I'm honestly curious that the error message isn't error 2147942402 (0x80070002) when launching `"/usr/bin/fish"'.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .