mirror of
https://github.com/zdharma-continuum/zconvey.git
synced 2026-09-10 07:06:21 -04:00
plugin.zsh: *is_session_active correctly handles current session. Uplift
This commit is contained in:
parent
3e7fe023d8
commit
c7e244e342
|
|
@ -89,10 +89,15 @@ function __zconvey_is_session_active() {
|
|||
return 2
|
||||
fi
|
||||
|
||||
if [[ "$idx" = "$ZCONVEY_ID" ]]; then
|
||||
# Return true - current session is active
|
||||
return 0;
|
||||
fi
|
||||
|
||||
integer is_locked=0
|
||||
local idfile="$ZCONVEY_LOCKS_DIR/zsh_nr${idx}" tmpfd
|
||||
|
||||
if [ -e "$idfile" ]; then
|
||||
if [[ -e "$idfile" ]]; then
|
||||
# Use zsystem only if non-blocking call is available (Zsh >= 5.3)
|
||||
if [ "${ZCONVEY_CONFIG[use_zsystem_flock]}" = "1" ]; then
|
||||
zsystem 2>/dev/null flock -t 0 -f tmpfd "$idfile"
|
||||
|
|
|
|||
Loading…
Reference in a new issue