formulahendry / formulahendry/vscode-code-runner

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

Offen
#511 1 Kommentar 2 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
TypeScript
Sterne
2.4k
Forks
351
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

- 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.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Beginne damit, den standardmäßigen Rust-Befehl auf CentOS 7 mit zsh zu reproduzieren, und vergleiche dann die Shell und PATH mit dem benutzerdefinierten Befehl, der source ~/.zshrc ausführt. Erledigt bedeutet, dass der standardmäßige rustc executor rustc finden kann, ohne dass Benutzer einen benutzerdefinierten executor-Befehl hinzufügen müssen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
rust, typescript, vscode, zsh
Bereich
tooling
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.