From 61257de6675bf35aa948ca758986ae87716fdf52 Mon Sep 17 00:00:00 2001 From: Eric Freese Date: Fri, 25 Aug 2023 16:24:02 -0600 Subject: [PATCH] Avoid accessing unset param when zsh/system is not available --- src/async.zsh | 4 ++-- zsh-autosuggestions.zsh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/async.zsh b/src/async.zsh index d08d944..a300a85 100644 --- a/src/async.zsh +++ b/src/async.zsh @@ -22,8 +22,8 @@ _zsh_autosuggest_async_request() { # Fork a process to fetch a suggestion and open a pipe to read from it exec {_ZSH_AUTOSUGGEST_ASYNC_FD}< <( - # Tell parent process our pid - echo $sysparams[pid] + # Tell parent process our pid if we can + echo ${sysparams[pid]:-} # Fetch and print the suggestion local suggestion diff --git a/zsh-autosuggestions.zsh b/zsh-autosuggestions.zsh index bd5aa3c..5520857 100644 --- a/zsh-autosuggestions.zsh +++ b/zsh-autosuggestions.zsh @@ -777,8 +777,8 @@ _zsh_autosuggest_async_request() { # Fork a process to fetch a suggestion and open a pipe to read from it exec {_ZSH_AUTOSUGGEST_ASYNC_FD}< <( - # Tell parent process our pid - echo $sysparams[pid] + # Tell parent process our pid if we can + echo ${sysparams[pid]:-} # Fetch and print the suggestion local suggestion