Skip to content

Conversation

@jnooree
Copy link

@jnooree jnooree commented Nov 24, 2025

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.

@jnooree jnooree force-pushed the fix/detect/termshell branch from 8d5ee27 to eacb22a Compare November 24, 2025 08:11
@CarterLi
Copy link
Member

Do the same for terminals?

1 similar comment
@CarterLi
Copy link
Member

Do the same for terminals?

@jnooree
Copy link
Author

jnooree commented Nov 24, 2025

Do the same for terminals?

Yes, if you could give me the code location, I can try fixing that too.

@CarterLi
Copy link
Member

Well, you know the file you modified is called terminalshell.c

@jnooree
Copy link
Author

jnooree commented Nov 24, 2025

Oh it's in the same file. Wait for me...

@jnooree
Copy link
Author

jnooree commented Nov 24, 2025

e914504 fixes terminal.

@CarterLi CarterLi requested a review from Copilot November 24, 2025 12:11
Copilot finished reviewing on behalf of CarterLi November 24, 2025 12:12
Copy link
Contributor

Copilot AI left a 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 exePath parameter
  • Added logic to select exePath over exe when exePath is 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.

jnooree and others added 2 commits November 25, 2025 09:07
@CarterLi CarterLi closed this in 5d13389 Nov 25, 2025
@jnooree jnooree deleted the fix/detect/termshell branch November 25, 2025 01:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants