fix: split shell exec pattern for terminal file picker on Windows - #2637
Open
weiningwei wants to merge 1 commit into
Open
fix: split shell exec pattern for terminal file picker on Windows#2637weiningwei wants to merge 1 commit into
weiningwei wants to merge 1 commit into
Conversation
Mingun
reviewed
Aug 19, 2026
Comment on lines
+344
to
+348
| FileTypeFilter = [new FilePickerFileType(shell.Name) | ||
| { | ||
| Patterns = shell.Exec.Split('|', | ||
| StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries) | ||
| }], |
Contributor
There was a problem hiding this comment.
It would beter to change shell.Exec type from String (?) to String[] if that possible.
Signed-off-by: weiningwei <weiningwei09@gmail.com>
weiningwei
force-pushed
the
fix/shell-terminal-picker-pattern
branch
from
August 19, 2026 12:20
84a3f02 to
bff6e20
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On Windows, the shell/terminal file picker in Preferences could not display
pwsh.exe/powershell.exewhen the user tried to manually select the PowerShell executable.Root cause
ShellOrTerminal.Execfor PowerShell is"pwsh.exe|powershell.exe", using|as a separator for alternative executable names. The file picker (SelectShellOrTerminalinsrc/Views/Preferences.axaml.cs) passed the entire string as a single glob pattern toFilePickerFileType.Patterns:Avalonia's Win32 implementation joins the patterns with
;and hands the result to the native file dialog, which treats|as a literal character rather than an alternative separator. Since no file is literally namedpwsh.exe|powershell.exe, the dialog showed nothing in the target directory.The other Windows terminals (
bash.exe,cmd.exe,wt.exe) use a single executable name and are unaffected.Fix
Split
Execon|so each alternative becomes its own pattern entry. For PowerShell this produces["pwsh.exe", "powershell.exe"], which the Win32 dialog matches aspwsh.exe;powershell.exe.No behavior change for terminals with a single executable name.