0

For some strange reason, whenever I try to create a new file from the command line visual studio code it does not work:

For example:

code hello.txt does not work. But if I want to open a directory with code . it does work. I already tried uninstalling vscode but it did not work as well.

P.S: This happens inside wsl2

2 Answers 2

1

Same issue here. As a workaround, you could add

new() {
    touch $1
    code $1
}

to ~/.bashrc, and open new files with new filename.

Sign up to request clarification or add additional context in comments.

Comments

1

I'm having the same issue, just started today. Oddly enough:

touch hello.txt
code hello.txt

Seems to work fine. Could potentially create a shortcut for that. Although the concern is if there's a setting that was inadvertently misconfigured.

1 Comment

yes I think I will open a bug report. I know about touch but I'm lazy :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.