https://github.com/zardoy/vscode-terminal-code-runner
https://github.com/zardoy/vscode-terminal-code-runner
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/zardoy/vscode-terminal-code-runner
- Owner: zardoy
- License: mit
- Created: 2021-10-27T03:59:36.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-03-12T18:45:03.000Z (over 3 years ago)
- Last Synced: 2025-02-13T03:41:21.779Z (over 1 year ago)
- Language: TypeScript
- Homepage: https://marketplace.visualstudio.com/items?itemName=zardoy.terminal-code-runner
- Size: 123 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.MD
- License: LICENSE
Awesome Lists containing this project
README
# Terminal Code Runner
This is extremely simplified and light version of [Code Runner](https://marketplace.visualstudio.com/items?itemName=formulahendry.code-runner) which supports running code only in terminal.
Why this instead of Code Runner:
- Support use different terminals for each file
- No [Conflict with Output Colorizer](https://github.com/formulahendry/vscode-code-runner/issues/59)
- [`preserveFocus` just works](https://github.com/formulahendry/vscode-code-runner/issues/715) - enable `focusOnEditor` setting
- [`clearPreviousOutput` works on Windows](https://github.com/formulahendry/vscode-code-runner/issues/704) - enable `clearTerminal` setting
## Configuration
Note, this is a completely different version. By default, this extension only support run `javascript` file. You can configure it to support other languages:
```jsonc
{
"terminalCodeRunner.execMap": {
// default
"javascript": "node ${relativeFile}",
// support run typescript file
// note: you need to install tsx by yourself, like npm install -g tsx
"typescript": "tsx ${relativeFile}"
}
}
```
You can also configure the executed command by [globs](https://code.visualstudio.com/api/references/vscode-api#GlobPattern):
```jsonc
{
"terminalCodeRunner.executorMapByGlob": {
// ${relativeFile} is VSCode variables, will fallback to file absolute path if no workspace opened
// check all variables here: https://code.visualstudio.com/docs/editor/variables-reference
"**/*.scpt": "osascript ${relativeFile}"
}
}
```