Open edwintorok opened 1 year ago
It looks as if docker
creates, not /run/.containerenv
, but /.dockerenv
, so we would want to update that test to
if _agkozak_is_ssh || (( EUID == 0 )) || [[ -f /.dockerenv || -f /run/.containerenv ]]; then
Perhaps you could confirm that that is the case? I don't use distrobox
, but that was a problem I ran into when I tried it out.
Your idea looks very clever to me. Give me a while to think if there are any downsides to using it, OK? Thanks so much.
I just opened an issue before checking this pull request, but I think it contemplates this subject. Please, check, if possible.
distrobox
(and other toolbox-like containers) set a hostname, and it is useful to be able to distinguish whether you are inside the container or outside. When /run/.containerenv is present then show the hostname, just as if it was an SSH-ed remote host.