Skip to content
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

Feature request/bug fix: "terminal.integrated.shell.container" option for container-specific shell setting #75717

Closed
nerdo opened this issue Jun 18, 2019 · 3 comments
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s) terminal Integrated terminal issues

Comments

@nerdo
Copy link

nerdo commented Jun 18, 2019

I'm not sure if this request belongs here or in the remote vscode extension, but it seems like we need a separate option to define the shell for containers.

What happens now:

  1. A container is started via docker, for example.
  2. The remote vscode extension sets up the server and one uses the container from vscode as if it were the host.
  3. Open a terminal and it uses the host's setting for "terminal.integrated.shell.linux" (or macos or windows).

It seems like the container needs its own separate setting for the shell.

I've run into this issue in linux where on the host I use zsh but in the container I only have bash set up. Opening up a terminal doesn't seem to be affected - it still works, but doing things like running tasks fails with the error execvp(3) failed.: No such file or directory, and it seems to be because it's using the host setting to try and run a command within the container.

When I change my "terminal.integrated.shell.linux" option to /bin/bash, everything works, but using this setting isn't accurate. If I were to switch over to my macos or windows machine where I have different settings, I would have to do the same thing, and it doesn't reflect the fact that the shell being set is actually the container's not the host's.

@vscodebot vscodebot bot added the terminal Integrated terminal issues label Jun 18, 2019
@Tyriar
Copy link
Member

Tyriar commented Jun 19, 2019

Default shells should just work in containers now microsoft/vscode-remote-release#38

@Tyriar Tyriar closed this as completed Jun 19, 2019
@Tyriar Tyriar added the *duplicate Issue identified as a duplicate of another issue(s) label Jun 19, 2019
@nerdo
Copy link
Author

nerdo commented Jun 21, 2019

Having the default shell working in containers helps, but it still doesn't solve this particular issue.

In my case, running tasks doesn't seem to be affected, or there is something else at play.

For example, I have a tasks to enable and disable XDebug in my container. These commands work fine if I open a shell and run them, e.g.:

/usr/sbin/phpenmod xdebug && /etc/init.d/php7.0-fpm restart

That works fine with or without the absolute path to phpenmod, btw.
But if I copy that same command into a task (regardless of the absolute path), here is what I get:

> Executing task: /usr/sbin/phpenmod xdebug && /etc/init.d/php7.0-fpm restart <

execvp(3) failed.: No such file or directory
The terminal process terminated with exit code: 1

Terminal will be reused by tasks, press any key to close it.

Setting terminal.integrated.shell.linux to /bin/sh (the default shell) works.

But in some cases I actually prefer to set it to the non-default. I have a similar task that involves running npm, and although it runs fine from the default shell (/bin/sh) when I run it interactively, for some reason, it does not work from a task. Setting the shell via terminal.integrated.shell.linux works though.

@Tyriar
Copy link
Member

Tyriar commented Jun 27, 2019

The task execvp issue was caused by something else and should be fixed now.

@Tyriar Tyriar reopened this Jun 27, 2019
@Tyriar Tyriar closed this as completed Jun 27, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Aug 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*duplicate Issue identified as a duplicate of another issue(s) terminal Integrated terminal issues
Projects
None yet
Development

No branches or pull requests

2 participants