Code-server: [v2] Use bash by default in the Docker container

Created on 18 Aug 2019  路  7Comments  路  Source: cdr/code-server

Description

Terminal does not start with bash shell when opened for the first time.

Screenshot 2019-08-18 at 13 35 52

question

Most helpful comment

just slap this in and this will make it the default


ENV SHELL /bin/bash

All 7 comments

In my experience it just uses your login shell. Could you try chsh -s bash and see if that helps?

vscode also has a setting to override the default shell used. In our case, it was easier to do something like:

cat << EOF > /home/coder/.config/code-server/User/settings.json
{
    "terminal.integrated.shell.linux": "/bin/bash"
}
EOF

since we also needed to override other settings.

For anyone wondering, VS Code uses $SHELL by default so this
happens when that environment variable isn't set.

Closing since I don't believe there is anything reasonable we can do here. If $SHELL isn't set sh is the safest fallback.

Reopening because in the Docker container at least we should be able to set the default shell to bash.

just slap this in and this will make it the default


ENV SHELL /bin/bash

I was thinking the same thing but then I wondered if we could pull it from the user. Normally I think login sets $SHELL based on /etc/passwd but maybe we can just read it ourselves when $SHELL isn't set. That would have the advantage of working in other situations as well.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rcarmo picture rcarmo  路  3Comments

sa7mon picture sa7mon  路  3Comments

pchecinski picture pchecinski  路  3Comments

chrischabot picture chrischabot  路  3Comments

oonqt picture oonqt  路  3Comments