formulahendry / formulahendry/vscode-code-runner

Can't use code-runner on 'Git Bash' with 'C++/Java' because '$dir' issue!

Open
#468 8 comments 2 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
2.4k
Forks
351
PR merge metrics
No merged PRs in 30d

Description

- VS Code Version: 1.33.1
- OS Version: Windows 10 Pro
- Code Runner Version: 0.9.8

**Describe the bug**
Languages using '$dir' value in "code-runner.executorMap" is not working because the format of "$dir" value is not for Git Bash.

![issue 2](https://user-images.githubusercontent.com/29764220/56702329-57316900-673e-11e9-9495-d202eb52870f.png)

Refer code-runner.executorMap,

"python": "python -u",
"cpp": "cd $dir && g++ $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",
"java": "cd $dir && javac $fileName && java $fileNameWithoutExt",

if (your code runner runs in integrated terimal && your terminal is git bash)
{
python is working in any workspace internal folder
cpp / java is not working in any directory
}

**To Reproduce**
Steps to reproduce the behavior:

1. Change to run code in Integrated Terminal.
"code-runner.runInTerminal": true,

2. Set terminal as Git Bash
"terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe"

3. Run code with any language using **"$dir"** in "code-runner.executorMap"
ex) C++, Java

You can refer below image.

![issue](https://user-images.githubusercontent.com/29764220/56702435-01a98c00-673f-11e9-84b8-5d71ba852e28.png)

**Actual behavior**

![actual behavior](https://user-images.githubusercontent.com/29764220/56702422-eb033500-673e-11e9-84ae-2a5ea008b1f6.png)

**Expected behavior**

![expected behavior](https://user-images.githubusercontent.com/29764220/56702432-fd7d6e80-673e-11e9-9328-2be1199ca057.png)

// As #106 is closed with no answer, I wrote this for more detailed debug information.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.