formulahendry / formulahendry/vscode-code-runner

.zshrc not sourced / zsh not used even if default? Causes rustc to not show up

Open
#511 1 comment 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.36.1
- OS Version: centOS 7
- Code Runner Version: 0.9.12

**Describe the bug**
When trying to run a rust progarm with the default configuration (`rustc $fileName`) I get
```
/bin/sh: rustc: command not found
```

If I run rustc normally from my terminal, I am able to compile my program.

I am using zsh, and I noticed that if I use a custom command for rust in the settings and I explicitly source my .zshrc file:
```
"code-runner.executorMap": {
"rust": "cd $dir && source ~/.zshrc && rustc $fileName && $dir$fileNameWithoutExt"
}
```
then the command runs fine.

If I echo my $SHELL in the code runner command for rust, I get /bin/zsh. But the error I get from running the default command says `/bin/sh: rustc: command not found`. Does this mean that code runner is somehow not using my default terminal (zsh)? Or for some reasons it is not sourcing my .zshrc? If I print my PATH in the code runner command, I noticed that I get the PATH defined by my .bashrc, and not my .zhsrc file.

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.