Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show username@host if inside a container #241

Closed
edouard-lopez opened this issue Dec 4, 2020 · 3 comments
Closed

Show username@host if inside a container #241

edouard-lopez opened this issue Dec 4, 2020 · 3 comments
Labels
🚀 enhancement performance, UX or maintainability 🙏 help wanted needs PR or help on decision 🙊 zsh implemented in Zsh version

Comments

@edouard-lopez
Copy link
Member

edouard-lopez commented Dec 4, 2020

related: #214


Testing this feature will prove challenging we run test in container so it's cool

@edouard-lopez edouard-lopez added 🙊 zsh implemented in Zsh version 🙏 help wanted needs PR or help on decision 🚀 enhancement performance, UX or maintainability labels Dec 4, 2020
@edouard-lopez
Copy link
Member Author

edouard-lopez commented Dec 4, 2020

function _pure_is_inside_container \
    --argument-names cgroup_namespace
    set --query cgroup_namespace[1]; or set cgroup_namespace /proc/1/cgroup

    begin
        test -r $cgroup_namespace
        and string match \
                --quiet \
                --entire \
                --regex '(lxc|docker)' \
            <$cgroup_namespace
    end
    or test $container = "lxc"
end

@jorgebucaran
Copy link
Contributor

@edouard-lopez Useless use of cat.

string match --quiet --entire --regex '(lxc|docker)' </proc/1/cgroup

@edouard-lopez
Copy link
Member Author

done #271

edouard-lopez added a commit that referenced this issue Aug 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚀 enhancement performance, UX or maintainability 🙏 help wanted needs PR or help on decision 🙊 zsh implemented in Zsh version
Projects
None yet
Development

No branches or pull requests

2 participants