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

How do I open a file in VSCodium from the terminal, and the jump to a desired line of code in it? #1928

Open
florinpatrascu opened this issue Jun 17, 2024 · 6 comments

Comments

@florinpatrascu
Copy link

Hi there,

I can open a file from the terminal for editing, using the command codium lib/a_file.ex (the file extension doesn't matter) and VSCodium functions correctly. However, when I attempt codium lib/a_file.ex:20, VSCodium tries to create a new file with the tab displaying a_file:20 as the file name. This functionality works in VSCode, and I'm curious if I'm making a mistake or if this feature is not yet supported in VSCodium. I'm using iTerm2 on macOS, but this issue persists in Terminal as well.

Thank you.

@daiyam
Copy link
Member

daiyam commented Jun 17, 2024

Humm... I can't do code lib/a_file.ex:20 either... Not sure what's going on.

@florinpatrascu
Copy link
Author

so .. after a fair amount of spelunking, the only way I can make it work is to use this form: codium -g lib/a_file.ex:20. It seems codium ignores the line number, unless explicitly requested to use it (the -g part, aka --goto <file:line[:character]>)

@daiyam
Copy link
Member

daiyam commented Jun 17, 2024

Reading https://code.visualstudio.com/docs/editor/command-line, and I can't find if code lib/a_file.ex:20 (with Visual Studio Code and without -g) is expected to do what you want. (It also doesn't work on my machine)

Could it be one of your extension adding the feature?

@florinpatrascu
Copy link
Author

None of my extensions are causing this behavior; it appears to be standard for VSCode. You might want to try using the full path in your case. If you have a project open and you want to open a file from the CLI, it will open the file even if the path is relative, as shown in my initial example.

@daiyam
Copy link
Member

daiyam commented Jun 18, 2024

You might want to try using the full path in your case.

I tried both relative and absolute, from Visual Studio Code or Terminal, I still don't have the behaviour you desire in Visual Studio Code.

Are you on arm64?

@florinpatrascu
Copy link
Author

Are you on arm64?

yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants