From f37ee4e8815a3866f3a1a5be57a6c0c27a960205 Mon Sep 17 00:00:00 2001 From: mikhailde Date: Mon, 14 Oct 2024 22:13:21 +0300 Subject: [PATCH] Fix(ssh-agent): Use "command" for reliable file type detection The "file" command was not working reliably in some environments. Using "command file" ensures consistent behavior across different systems. --- plugins/ssh-agent/ssh-agent.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/ssh-agent/ssh-agent.plugin.zsh b/plugins/ssh-agent/ssh-agent.plugin.zsh index acf56cc35..01a333072 100644 --- a/plugins/ssh-agent/ssh-agent.plugin.zsh +++ b/plugins/ssh-agent/ssh-agent.plugin.zsh @@ -45,7 +45,7 @@ function _add_identities() { # Iterate over files in .ssh folder. for file in "$HOME/.ssh"/*; do # Check if file is a valid private key using file magic. - if [[ -f "$file" && $(file -b "$file") == *"private key"* ]]; then + if [[ -f "$file" && $(command file -b "$file") == *"private key"* ]]; then # Add filename (without path) to identities array. identities+=("${file##*/}") fi