From c7e244e342f2f504eba0017e9448595edbd0fe11 Mon Sep 17 00:00:00 2001 From: Sebastian Gniazdowski Date: Mon, 6 Mar 2017 10:43:43 +0100 Subject: [PATCH] plugin.zsh: *is_session_active correctly handles current session. Uplift --- zconvey.plugin.zsh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/zconvey.plugin.zsh b/zconvey.plugin.zsh index 3bdb087..d99c030 100644 --- a/zconvey.plugin.zsh +++ b/zconvey.plugin.zsh @@ -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"