-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pipe commands have issues in devcontainers #321
Comments
Thanks for the report! The bug is also on the release version. I investigated a bit and it's quite strange:
Since commands need |
Piping does indeed work locally. I tried version From that, I figured out that piping works (on latest) if I do
So I'm guessing running |
I experimented a bit more with ways to use built-in VS Code APIs rather than In both cases, I execute a const task = new vscode.Task(
{ type: "process" },
vscode.TaskScope.Workspace,
"Run Dance command",
"Dance",
new vscode.ProcessExecution(
"/bin/sh",
[
"-c",
`...`,
],
{
// VS Code will fail to compute `cwd` if there is no workspace folder. Help it.
cwd: cwd ?? process?.cwd() ?? "/",
env: {
DANCE_COMMAND: command,
DANCE_INPUT: input ?? "",
...givenEnv,
},
},
),
);
task.presentationOptions = {
reveal: vscode.TaskRevealKind.Silent,
echo: true,
focus: false,
panel: vscode.TaskPanelKind.New,
showReuseMessage: false,
clear: true,
// @ts-expect-error: only recognized by "process" tasks
close: true,
};
const execution = await vscode.tasks.executeTask(task); The problem is that there is no API to get the output of the command. I tried two things to get around this problem, both of which work in local scenarios (replace
Other problemsExecuting commands using Also, the above solution works with Way forwardFor remote scenarios, I believe the only way to make things work is to create a new extension (potentially named "Dance - Remote command execution") which is installed in the remote (unlike Dance, which is installed in the client), with which Dance can communicate to run commands locally (either with The proposed API |
I tried a bit more to get it working in a devcontainer by using Perhaps using automatic VS Code port forwarding and setting up a |
Separating the piping into its own extension isn't a bad idea, it's already solid functionality in and of itself. There's similar alternatives but I really like the js/shell pattern going on there (with But, on the old version, 0.5.12001, pipes work, they just run on the host instead of inside the container. Any idea what's different there? |
Oh, that's right, they did work before... It looks like if I remove |
This should be fixed by e9cd2ca. |
I'm on the pre-release version and seeing some issues w/ in dev containers especially:
Dev Containers: New Dev Container...
command), I picked Alpine w/ defaultserror executing command "dance.selections.pipe.replace": Invalid host defined options
I didn't look into how to debug/test the issue, devcontainers like to install extensions from the store.
The text was updated successfully, but these errors were encountered: