This is a vscode
extension to run C
, C++
, python
, Rust
, java
, javascript
files in vscode terminal.
It just cd
into the file directory. then clears the terminal. Then runs the program.
Install this extension.
First open a C
, C++
, python
, rust
, java
, javascript
files. Do one of these following.
- use shortcut
Ctrl+Alt+C
to run the file - right click the Text Editor and then click
Compile and run
in editor context menu - click
Quick Run
button in title menu - Open
command palette
and searchQuick Run
abd hit enter.
- compile and run
C/C++
file - compile and run
python
file - compile and run
java
file - compile and run
rust
file - compile and run
javascript
file
A compiler/interpreter for your favorite language.
❗️ Important: default C/C++ compiler is set to
gcc
/g++
, For python it is set topython
. If you want to use different compiler/interpreter see configurations example.
{
// clears the terminal before run.
"quickRunInTerminal.clearBeforeRun": true,
// If false saves only active file, otherwise saves all files.
"quickRunInTerminal.saveAllFilesBeforeRun": false,
// empty string means name of the program followed by exe/out
"quickRunInTerminal.binaryOutputName": "",
// C/C++
"quickRunInTerminal.C_compilerPath": "gcc",
"quickRunInTerminal.Cpp_compilerPath": "g++",
// Python
"quickRunInTerminal.Python_interpreterPath": "python",
// Rust
"quickRunInTerminal.Rust_compilerPath": "rustc",
// Java
"quickRunInTerminal.Java_CompilerPath": "javac",
"quickRunInTerminal.Java_Runtime": "java",
// JavaScript
"quickRunInTerminal.JavaScript_interpreterPath": "node",
}
Lets say you want to use python3
instade of python
as interpreter.
- go to settings.
- search
quick run in terminal
. - Find the section where says
Quick Run In Terminal: Python_interpreter Path
. - set that to
python3
as python interpreter.
For C/C++
find Quick Run In Terminal: C_compiler Path
or Quick Run In Terminal: C_compiler Path
to gcc
/clang
/g++
/cc
or whatever.
{
"quickRunInTerminal.Python_interpreterPath": "/home/user/bin/python3",
"quickRunInTerminal.Python_interpreterPath": "python3",
"quickRunInTerminal.Cpp_compilerPath": "/usr/g++",
"quickRunInTerminal.C_compilerPath": "clang"
}
NOTE: It says
path
but if the program is accessable from anywhere then you can just put program name.
- report bugs/issues here github issues