summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorohmyzsh[bot] <54982679+ohmyzsh[bot]@users.noreply.github.com>2025-05-11 11:06:03 +0200
committerGitHub <noreply@github.com>2025-05-11 11:06:03 +0200
commit3f8ea81b89cda583acea098c9b7353c295619d4d (patch)
tree43815fc218134eb06cd2daf2caac14c490275556 /plugins
parent62afbdebb96bf91c044a92b75d86f85a67da67a7 (diff)
downloadzsh-3f8ea81b89cda583acea098c9b7353c295619d4d.tar.gz
zsh-3f8ea81b89cda583acea098c9b7353c295619d4d.tar.bz2
zsh-3f8ea81b89cda583acea098c9b7353c295619d4d.zip
feat(z): update to cf9225fe (#13115)
Co-authored-by: ohmyzsh[bot] <54982679+ohmyzsh[bot]@users.noreply.github.com>
Diffstat (limited to 'plugins')
-rw-r--r--plugins/z/LICENSE2
-rw-r--r--plugins/z/z.plugin.zsh13
2 files changed, 12 insertions, 3 deletions
diff --git a/plugins/z/LICENSE b/plugins/z/LICENSE
index 162cba8d1..b36aeb408 100644
--- a/plugins/z/LICENSE
+++ b/plugins/z/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2018-2024 Alexandros Kozak
+Copyright (c) 2018-2025 Alexandros Kozak
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/plugins/z/z.plugin.zsh b/plugins/z/z.plugin.zsh
index bf15b01de..39b832292 100644
--- a/plugins/z/z.plugin.zsh
+++ b/plugins/z/z.plugin.zsh
@@ -4,7 +4,7 @@
#
# https://github.com/agkozak/zsh-z
#
-# Copyright (c) 2018-2024 Alexandros Kozak
+# Copyright (c) 2018-2025 Alexandros Kozak
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@@ -294,7 +294,16 @@ zshz() {
owner=${ZSHZ_OWNER:-${_Z_OWNER}}
if (( ZSHZ[USE_FLOCK] )); then
- ${ZSHZ[MV]} "$tempfile" "$datafile" 2> /dev/null || ${ZSHZ[RM]} -f "$tempfile"
+ # An unsual case: if inside Docker container where datafile could be bind
+ # mounted
+ if [[ -r '/proc/1/cgroup' && "$(< '/proc/1/cgroup')" == *docker* ]]; then
+ print "$(< "$tempfile")" > "$datafile" 2> /dev/null
+ ${ZSHZ[RM]} -f "$tempfile"
+ # All other cases
+ else
+ ${ZSHZ[MV]} "$tempfile" "$datafile" 2> /dev/null ||
+ ${ZSHZ[RM]} -f "$tempfile"
+ fi
if [[ -n $owner ]]; then
${ZSHZ[CHOWN]} ${owner}:"$(id -ng ${owner})" "$datafile"