Skip to content

Commit d7e9094

Browse files
committed
Shell (macOS): better xonsh detection
Fix #977
1 parent 1863bde commit d7e9094

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Features:
1515
* See `fastfetch -h format` for detail
1616
* Add option `--color-separator` to set the color of key-value separators
1717
* Support Guix package manager count (#792, Packages, Linux)
18+
* Improve python based shell detection (#977, Shell, macOS)
1819

1920
Bugfixes:
2021
* Don't detect `.conf` files in `--list-config-paths`

src/common/processing_linux.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,18 @@ void ffProcessGetInfoLinux(pid_t pid, FFstrbuf* processName, FFstrbuf* exe, cons
165165

166166
do arg0++; while (*arg0 == '\0');
167167
assert(arg0 < procArgs2 + len);
168+
169+
{
170+
// #977
171+
char* p = (char*) strrchr(arg0, '/');
172+
if (p)
173+
{
174+
p++;
175+
if (ffStrStartsWithIgnCase(p, "python")) // /opt/homebrew/Cellar/[email protected]/3.12.3/Frameworks/Python.framework/Versions/3.12/Resources/Python.app/Contents/MacOS/Python /Users/carter/.local/bin/xonsh
176+
arg0 = p + strlen(p) + 1;
177+
}
178+
}
179+
168180
if (*arg0 == '-') arg0++; // Login shells
169181

170182
ffStrbufSetS(exe, arg0);

0 commit comments

Comments
 (0)