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

VS Code dev containers do not respect the default shell for first new terminal opened #142649

Closed
dslatkin opened this issue Feb 9, 2022 · 5 comments
Assignees
Labels
info-needed Issue requires more information from poster

Comments

@dslatkin
Copy link

dslatkin commented Feb 9, 2022

Does this issue occur when all extensions are disabled?: Yes

  • This happens on both Windows and Mac host machines for me.
  • VS Code Version: 1.64.1
  • OS Version: Linux x64 5.10.16.3-microsoft-standard-WSL2

Steps to Reproduce:

  1. Ensure Docker and the "Remote Development" extension pack is installed
  2. Ensure local settings.json is configured with:
{
  "dotfiles.repository": "https://github.com/dslatkin/dotfiles.git",
  "dotfiles.targetPath": "~/dotfiles",
  "dotfiles.installCommand": "~/dotfiles/install.sh",
  "terminal.integrated.defaultProfile.linux": "fish",
  "terminal.integrated.profiles.linux": {
    "fish": {
      "path": "/usr/bin/fish"
    }
  }
}
  1. Open the command palette and choose "Clone Repository in Container Volume"
  2. Use the repository https://github.com/dslatkin/dotfiles.git since it can reproduce this
  3. Wait for the container to finish building and dotfiles/new shell to install before opening a terminal
  4. Open a new terminal, note it's /bin/bash, which is unexpected
  5. Open another new terminal, note it's now /usr/bin/fish
  6. Exiting terminals and reopening the container without rebuild always uses /usr/bin/fish as expected

I have some debug information from the dotfiles install script on these lines that is outputting the user and /etc/passwd as part of the dotfiles install. It looks like the default shell is being set up, so I'm not sure why the first terminal opens always uses bash and not fish. Here's the example of that output from a run:

[75057 ms] fish, version 3.3.1
[75057 ms] 🚀 Dotfiles: Changing shell for vscode
[75057 ms] root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin
sys:x:3:3:sys:/dev:/usr/sbin/nologin
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/usr/sbin/nologin
man:x:6:12:man:/var/cache/man:/usr/sbin/nologin
lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin
mail:x:8:8:mail:/var/mail:/usr/sbin/nologin
news:x:9:9:news:/var/spool/news:/usr/sbin/nologin
uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin
proxy:x:13:13:proxy:/bin:/usr/sbin/nologin
www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
backup:x:34:34:backup:/var/backups:/usr/sbin/nologin
list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin
irc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologin
gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin
nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin
_apt:x:100:65534::/nonexistent:/usr/sbin/nologin
vscode:x:1000:1000::/home/vscode:/bin/bash
[75079 ms] 🚀 Dotfiles: Shell changed
[75079 ms] root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin
sys:x:3:3:sys:/dev:/usr/sbin/nologin
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/usr/sbin/nologin
man:x:6:12:man:/var/cache/man:/usr/sbin/nologin
lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin
mail:x:8:8:mail:/var/mail:/usr/sbin/nologin
news:x:9:9:news:/var/spool/news:/usr/sbin/nologin
uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin
proxy:x:13:13:proxy:/bin:/usr/sbin/nologin
www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
backup:x:34:34:backup:/var/backups:/usr/sbin/nologin
list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin
irc:x:39:39:ircd:/var/run/ircd:/usr/sbin/nologin
gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/usr/sbin/nologin
nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin
_apt:x:100:65534::/nonexistent:/usr/sbin/nologin
vscode:x:1000:1000::/home/vscode:/usr/bin/fish
[75079 ms] 🚀 Dotfiles: Install starship
@dslatkin dslatkin changed the title VS Code dev containers does not respect the default shell on first container load/terminal VS Code dev containers do not respect the default shell for first new terminal opened Feb 9, 2022
@dslatkin
Copy link
Author

dslatkin commented Feb 9, 2022

This issue may be related to #142425, but this is probably more easily reproducible since it's using dev containers with public dotfiles on a public repo, as opposed to SSH containers.

@dslatkin
Copy link
Author

I've updated the original issue to note that this is reproducible on both Windows and Mac for me using the dotfiles repo referenced in this issue.

I still think this is likely related to #142425.

@niccolomineo
Copy link

I have always had this problem in dev containers but not locally. 🤷🏻‍♂️

@meganrogge
Copy link
Contributor

does it reproduce locally for you @dslatkin ?

@meganrogge meganrogge added the info-needed Issue requires more information from poster label Jul 29, 2022
@vscodenpa
Copy link

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!

@github-actions github-actions bot locked and limited conversation to collaborators Sep 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

4 participants