Note: the setting.json
file I was editing was given by the command >Preferences: Open User Settings (JSON)
In the file you can find the following code
"terminal.integrated.profiles.linux": {
"bash": {
"path": "bash",
"icon": "terminal-bash"
},
"zsh": {
"path": "zsh"
},
"fish": {
"path": "fish"
},
"tmux": {
"path": "tmux",
"icon": "terminal-tmux"
},
"pwsh": {
"path": "pwsh",
"icon": "terminal-powershell"
}
}
I added a new profile:
"bash (2)": {
"path": "/bin/bash",
"icon": "terminal-bash",
"args": ["--login"]
}
When connecting to the remote machine, the default profile can be selected
Then, a drop-down menu will appear on the top bar showing all the possible profiles
As expected, the "bash (2)" profile appears with the correct argument.
When launching again the shell, hovering over its icon should display the launch command
which is what we wanted.
Unfortunately, this didn't solve my problem: the .bashrc
file wasn't run since the new shell was launched as 'root' user, not as 'ubuntu' user (for which I defined the bashrc file)
To solve this, I simply run >Dev Containers: Open Container Configuration File
and edited as follows
{
"remoteUser": "ubuntu",
"workspaceFolder": "/home/ubuntu",
"settings": {
"terminal.integrated.shellIntegration.enabled": false
}
}
This solved my problem.