Here is the problem. I want to use the VSCode terminal command code test.txt
to create the file test.txt
and open it in VSCode.
This works perfectly fine on Linux(Both EL9 and CentOS7) and my old Intel chip X86 MacBook.
However, on my new MacBook, which is an apple silicon M1pro version, it went wrong. If the file already exists, the command code existedfile
could open the existedfile
in VSCode. If not, the command code test.txt
would return The file test.txt does not exist
.
So what could I do to permanently fix this issue? I don’t want to touch newfile
and then code newfile
every time I encounter similar situation.
I tried the instructions from the Internet: install code
command in PATH and reopen the terminal. This doesn’t work.
RedQuark is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.