-
-
Notifications
You must be signed in to change notification settings - Fork 631
fix(detection/terminalshell): use absolute path to shell if available #2067
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
8d5ee27 to
eacb22a
Compare
|
Do the same for terminals? |
1 similar comment
|
Do the same for terminals? |
Yes, if you could give me the code location, I can try fixing that too. |
|
Well, you know the file you modified is called |
|
Oh it's in the same file. Wait for me... |
|
e914504 fixes terminal. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR modifies the terminal and shell detection logic to prefer absolute paths (exePath) over executable names (exe) when available. The change ensures that the correct shell binary is used for version detection, avoiding cases where the executable name might resolve to a different location than the actual login shell.
Key Changes
- Refactored shell version detection functions to accept only the executable path parameter, removing the separate
exePathparameter - Added logic to select
exePathoverexewhenexePathis available before calling version detection functions - Applied consistent handling across both Windows and Linux platforms
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| terminalshell_windows.c | Selects exePath over exe when available before calling fftsGetTerminalVersion |
| terminalshell_linux.c | Selects exePath over exe when available before calling fftsGetTerminalVersion |
| terminalshell.c | Refactored getShellVersionBash and getShellVersionZsh to remove exePath parameter and added path selection logic in fftsGetShellVersion |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sometimes shell executable name (
exe; e.g.,zsh) might resolve to a different path than path to the login shell (exePath; e.g.,/bin/zsh). This PR tries to use absolute path to the login shell if possible, and fallback to previous behavior if absolute path is not available.