From ad4753e3d4e91fc758a0e40f048b087aaa10bbf3 Mon Sep 17 00:00:00 2001 From: Fabio Scotto di Santolo Date: Thu, 2 Apr 2026 16:56:40 +0200 Subject: [PATCH] Prefer visible Ubuntu profile in Windows Terminal --- .../roles/profile_workstation_host_windows/tasks/main.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ansible/roles/profile_workstation_host_windows/tasks/main.yml b/ansible/roles/profile_workstation_host_windows/tasks/main.yml index a248cd7..93730ea 100644 --- a/ansible/roles/profile_workstation_host_windows/tasks/main.yml +++ b/ansible/roles/profile_workstation_host_windows/tasks/main.yml @@ -208,11 +208,13 @@ } $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 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) {