Skip to content

Commit 84a3f02

Browse files
committed
fix: split shell exec pattern for terminal file picker on Windows
PowerShell's Exec uses `|` to separate alternative executable names, but the file picker treated the whole string as a single glob, so pwsh.exe / powershell.exe could not be selected. Split on `|` into separate patterns. refactor: extract shell exec pattern split into a local variable refactor: wrap shell exec pattern split across lines Replaces the previously extracted local variable with a multi-line expression for better readability.
1 parent 415564b commit 84a3f02

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎src/Views/Preferences.axaml.cs‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,11 @@ private async void SelectShellOrTerminal(object _, RoutedEventArgs e)
341341
{
342342
options = new FilePickerOpenOptions()
343343
{
344-
FileTypeFilter = [new FilePickerFileType(shell.Name) { Patterns = [shell.Exec] }],
344+
FileTypeFilter = [new FilePickerFileType(shell.Name)
345+
{
346+
Patterns = shell.Exec.Split('|',
347+
StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries)
348+
}],
345349
AllowMultiple = false,
346350
};
347351
}

0 commit comments

Comments
 (0)