Repository navigation
Automatically resolve Default Shell Command from PATH - #3033
Conversation
a819fd2 to
d94f53a
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Command resolution can override empty-input fallback behavior and substitute executables for invalid explicit paths.
2 open issues
What changed in this PR
Adds PATH-based shell command resolution to the local terminal preferences.
Changes:
- Resolves shell commands during validation and saving.
- Updates the command field with the resolved path on Apply.
- Clarifies that the shell preferences apply across operating systems.
| File | Description |
|---|---|
| terminal/bundles/org.eclipse.terminal.view.ui/src/org/eclipse/terminal/view/ui/IPreferenceKeys.java | Clarifies cross-platform preference documentation. |
| terminal/bundles/org.eclipse.terminal.view.ui/src/org/eclipse/terminal/view/ui/internal/preferences/PreferencePage.java | Adds executable resolution and refreshes the saved command field. |
Review effort: Balanced
d94f53a to
2fc575a
Compare
|
I addressed the copilot suggestions. |
fe3474f to
e7f9dce
Compare
|
@merks Would you like to review this (the pushes were just rebasing)? |
merks
left a comment
There was a problem hiding this comment.
I've been noticing these changes earlier. It seems like a good/convenient idea to resolve paths from the PATH. In general I wonder if we shouldn't be careful to use getCanonicalPath somewhere, especially on Windows, so that the case is exactly as it is in the file system. Maybe that should be the case even if a full path is specified; maybe that's the case, I haven't looked at the whole file.
e7f9dce to
eafdc57
Compare
eafdc57 to
13f4e85
Compare

In the preferences, users can enter a shell command in Terminal > Local Terminal. This command is used by default when running a local terminal.
Currently, this option only allows entering full paths to the executables. This PR changes that to also resolve executables from the
PATHvariable if present. When clicking theApplybutton, the shell command is set to the absolute path of the executable.Screencast_20261019_192005.webm
This was suggested in #2932.
I also updated the Javadocs of
PREF_LOCAL_TERMINAL_DEFAULT_SHELL_UNIXandPREF_LOCAL_TERMINAL_DEFAULT_SHELL_UNIX_ARGSaccording to #2932 (comment).This PR also comes with another minor change compared to the current version: Previously, the
Shell Commandfield in the preference editor was not updated with the normalized path (removing spaces, replacing slashes to backslashes on Windows, etc). Users would only see those changes after reopening the preference dialog (or navigating to another section and then going back). With this PR, the field now does this when clicking on theApplybutton.Note: I only tested this on Linux.