Closed TimSpence closed 4 years ago
I personally run a lot of things locally in a container and the container share my hosts hostname and username. Therefore it's not really meaningful for me to show this information. Couple of options:
1) Add an option for disabling this feature. 2) Check that if the username@host is identical between the host and the container, don't show it.
Check that if the username@host is identical between the host and the container, don't show it.
👍
Issue
When running a shell inside a docker or LXC container, the pure prompt does not display user@hostname as when logged in to a remote computer via SSH.
Fix
After executing a command on the wrong LXC container yesterday, I found a few reliable methods for determining whether the shell is executing inside a container.
container=lxc
.init
process indicates "docker" or "lxc".After the fix, the pure prompt retains the default behavior which hides user@host when physically logged in to a computer.
Testing
LXC:
Ubuntu 20.04 (bare metal):
OS X Catlina (physical computer, attached with keyboard:
Docker container: