Skip to content

Commit 30d23cb

Browse files
authored
Detect when inside an OCI container (#655)
1 parent 2f13dea commit 30d23cb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pure.zsh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -722,12 +722,13 @@ prompt_pure_state_setup() {
722722
)
723723
}
724724

725-
# Return true if executing inside a Docker, LXC or systemd-nspawn container.
725+
# Return true if executing inside a Docker, OCI, LXC, or systemd-nspawn container.
726726
prompt_pure_is_inside_container() {
727727
local -r cgroup_file='/proc/1/cgroup'
728728
local -r nspawn_file='/run/host/container-manager'
729729
[[ -r "$cgroup_file" && "$(< $cgroup_file)" = *(lxc|docker)* ]] \
730730
|| [[ "$container" == "lxc" ]] \
731+
|| [[ "$container" == "oci" ]] \
731732
|| [[ -r "$nspawn_file" ]]
732733
}
733734

0 commit comments

Comments
 (0)