Reputation: 649
In this section: https://code.visualstudio.com/docs/editor/codebasics#_additional-command-line-arguments
It states you can use --goto
to open a file at a specific line. I grep code with AstroGrep and every time I try to use the --goto
argument VsCode fails to open.
An example argument i'm using which fails:
Code.exe --goto C:\filepath\filename.txt:450:11
or
Code.exe --goto "C:\file path\filename.txt":450:11
What is wrong with this file:line:column syntax? or is this a bug in vscode?
Thanks
Upvotes: 33
Views: 14879
Reputation: 84
In MacOS, I achieve the same thing by running
// `code` should be added to PATH beforehand
code --goto "<filepath>:<linenumber>:<x-coordinates>"
Upvotes: 1
Reputation: 231
Code.exe --goto "C:\file path\filename.txt:450:11"
worked for me, take a closer look on the quotation marks.
Upvotes: 23