Skip to content

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

@dslatkin

Description

@dslatkin

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

Metadata

Metadata

Assignees

Labels

info-neededIssue requires more information from poster

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions