Opening file from command line
Hi,
Is there a way to open a file from the command line into a _currently_ running CLion session? I.e. do the equivalent of 'Navigate'/'Files' from a terminal window.
Thanks,
Philippe.
Please sign in to leave a comment.
Hi Philippe.
If you perform the command described at https://www.jetbrains.com/idea/help/working-with-intellij-idea-features-from-command-line.html in “Opening file in the editor” (replace IntellijJ IDEA with CLion, of course) the file is opened in the existing window if the desired project is already opened.
Hi Anna,
When I try the recipe (with CLion 1.2) I get
and in the running CLion there is an error message complaining that /Applications/CLion.app/Contents/bin/./inspect does not exist.
Thanks,
Philippe
Philippe,
Could you please specify which command did you use?
I tried:
where /opt/build/root_builds/rootcling.debug is the location of the (already opened) project and /opt/build/root_builds/rootcling.debug/src/core/base/src/TROOT.cxx the location of the file.
Thanks,
Philippe.
Hi Philippe.
Sorry for the delay!
To open file for editing please type the following in the command line:
where:
An example for OS X:
/Applications/CLion.app/Contents/MacOS/clion ~/CLionProjects/untitled45 --line 1 ~/CLionProjects/untitled45/sample.txt
Does that help?
Hi Anna,
This is indeed working. Thanks,
I see the --line option, where can I find the complete list of supported command line options?
Thanks,
Philippe.
Is there any way to automatically use the current project if only one instance of clion is open?