Closed rodber closed 3 years ago
I just guess, this issue may be caused by the plugin making the terminal CWD (current working directory) to be current vscode working directory.
I accept this feature from one of my issues.
Already released v1.4.4, try it.
Using workingDirectoryAsCWD true
"workingDirectoryAsCWD": true,
"command": "echo ${cwd}",
Result (I get the same result using true or false):
Running "echo /"
/
Now the only way to run my command is to:
"command": "cd ${workspaceFolder} && vendor/bin/ecs check ${file} --fix",
Otherwise I get:
/bin/sh: vendor/bin/ecs: No such file or directory
And by the way, the shell is still not ready and I still need to restart.
It seems your problem doesn't have any relationship with the CWD...
I changed the default value of workingDirectoryAsCWD
to true
now.
Still need some research on this problem.
@pucelle
I have some additional information about this problem. The issue for me was that my PATH didn't include executables installed by by Homebrew. I think this is because when node.child_process uses a non-interactive shell. That means that .zprofile and .zshrc are not processed.
I was able to work around this by using the full path to the shell command I want to run.
"command": "/usr/local/bin/{command} --args ..."
https://apple.stackexchange.com/questions/388622/zsh-zprofile-zshrc-zlogin-what-goes-where
I've spotted an issue affecting the backend shell when using homebrew. The problem is that the backed shell doesn't behave as the integrated terminal.
This happens when using
zsh
from homebrew and launching VS Code before homebrew wires the shell. This is the trickiest part of this bug, if you wait ~30s after login in this will work as expected and you won't be able to reproduce the bug.I doubt that this error is caused by the extension, in any case here's my findings.
POC
Configuration:
Trigger a save, the results are:
If you switch to this configuration:
You will get this:
Workarounds
Homebrew
I related this to homebrew because If you login, then right away open a terminal and run
which some_binary_provided_by_homebrew
it will take some time to respond. If you launch VS Code while homebrew is being loaded it will cause"runIn": "backend"
to don't behave as expected.