From 14bde2e49b897ac7d38d57e1325f80b6fb10be05 Mon Sep 17 00:00:00 2001 From: Azalea <22280294+hykilpikonna@users.noreply.github.com> Date: Mon, 14 Aug 2023 20:56:27 -0700 Subject: [PATCH] [F] Find actual editor name by tracing symlinks --- neofetch | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/neofetch b/neofetch index 0247a869..ec478d6d 100755 --- a/neofetch +++ b/neofetch @@ -2278,6 +2278,12 @@ get_editor() { # in case neither is set just return [[ -z "$editor_full_path" ]] && return + # Actually obtain the full path + editor_full_path="$(which "${editor_full_path}" 2>/dev/null)" + + # Resolve symlink and get the original name + [[ -L "$editor_full_path" ]] && editor_full_path="$(readlink -f "$editor_full_path")" + case $editor_path in on) editor="${editor_full_path} " ;; off) editor="${editor_full_path##*/} " ;;