diff --git a/CHANGELOG.md b/CHANGELOG.md index c60906388..d1f0cb5f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ Features: * See `fastfetch -h format` for detail * Add option `--color-separator` to set the color of key-value separators * Support Guix package manager count (#792, Packages, Linux) +* Improve python based shell detection (#977, Shell, macOS) Bugfixes: * Don't detect `.conf` files in `--list-config-paths` diff --git a/src/common/processing_linux.c b/src/common/processing_linux.c index 912cbc7f4..24ae675b8 100644 --- a/src/common/processing_linux.c +++ b/src/common/processing_linux.c @@ -165,6 +165,18 @@ void ffProcessGetInfoLinux(pid_t pid, FFstrbuf* processName, FFstrbuf* exe, cons do arg0++; while (*arg0 == '\0'); assert(arg0 < procArgs2 + len); + + { + // #977 + char* p = (char*) strrchr(arg0, '/'); + if (p) + { + p++; + if (ffStrStartsWithIgnCase(p, "python")) // /opt/homebrew/Cellar/python@3.12/3.12.3/Frameworks/Python.framework/Versions/3.12/Resources/Python.app/Contents/MacOS/Python /Users/carter/.local/bin/xonsh + arg0 = p + strlen(p) + 1; + } + } + if (*arg0 == '-') arg0++; // Login shells ffStrbufSetS(exe, arg0);