Prefer visible Ubuntu profile in Windows Terminal

This commit is contained in:
Fabio Scotto di Santolo
2026-04-02 16:56:40 +02:00
parent f01dc21acf
commit ad4753e3d4

View File

@@ -208,11 +208,13 @@
} }
$targetProfile = $settings.profiles.list | $targetProfile = $settings.profiles.list |
Where-Object { $_.name -eq '{{ windows_terminal_default_profile_name }}' } | Where-Object {
$_.name -eq '{{ windows_terminal_default_profile_name }}' -and -not ($_.PSObject.Properties.Name -contains 'hidden' -and $_.hidden)
} |
Select-Object -First 1 Select-Object -First 1
if ($null -eq $targetProfile) { if ($null -eq $targetProfile) {
throw "Windows Terminal profile '{{ windows_terminal_default_profile_name }}' was not found. Ensure the Ubuntu WSL profile exists in Windows Terminal first." throw "Windows Terminal visible profile '{{ windows_terminal_default_profile_name }}' was not found. Ensure the Ubuntu WSL profile exists and is not hidden in Windows Terminal first."
} }
if ($settings.defaultProfile -eq $targetProfile.guid) { if ($settings.defaultProfile -eq $targetProfile.guid) {