Compare commits

..

2 Commits

Author SHA1 Message Date
copilot-swe-agent[bot]
f003e277cb Fix crash when opening terminal profile in new tab with quake window active
Agent-Logs-Url: https://github.com/microsoft/PowerToys/sessions/cf61eae9-f97c-405d-ae59-c0a3a09c7ae3

Co-authored-by: MuyuanMS <116717757+MuyuanMS@users.noreply.github.com>
2026-04-29 10:20:15 +00:00
copilot-swe-agent[bot]
2a293eccd1 Initial plan 2026-04-29 08:50:42 +00:00
7 changed files with 7 additions and 7 deletions

View File

@@ -129,8 +129,8 @@ public partial class ContentPageViewModel : PageViewModel, ICommandBarContext
UpdateDetails();
model.ItemsChanged += Model_ItemsChanged;
FetchContent();
model.ItemsChanged += Model_ItemsChanged;
DoOnUiThread(
() =>

View File

@@ -44,9 +44,9 @@ public partial class ContentTreeViewModel(ITreeContent _tree, WeakReference<IPag
UpdateProperty(nameof(Root));
}
FetchContent();
model.PropChanged += Model_PropChanged;
model.ItemsChanged += Model_ItemsChanged;
FetchContent();
}
// Theoretically, we should unify this with the one in CommandPalettePageViewModelFactory

View File

@@ -209,8 +209,8 @@ public sealed partial class DockBandViewModel : ExtensionObjectViewModel
var list = command.Model.Unsafe as IListPage;
if (list is not null)
{
list.ItemsChanged += HandleItemsChanged;
InitializeFromList(list);
list.ItemsChanged += HandleItemsChanged;
}
else
{

View File

@@ -957,8 +957,8 @@ public partial class ListViewModel : PageViewModel, IDisposable
Filters?.InitializeProperties();
UpdateProperty(nameof(Filters));
model.ItemsChanged += Model_ItemsChanged;
FetchItems(true);
model.ItemsChanged += Model_ItemsChanged;
}
private static IGridPropertiesViewModel? LoadGridPropertiesViewModel(IGridProperties? gridProperties)

View File

@@ -31,7 +31,7 @@ public static class TerminalHelper
}
else if (openNewTab)
{
argsPrefix = "--window 0 nt";
argsPrefix = "nt";
}
return $"{argsPrefix} --profile \"{profileName}\"";

View File

@@ -18,7 +18,7 @@ namespace Microsoft.Plugin.WindowsTerminal.UnitTests
[DataTestMethod]
[DataRow("Windows PowerShell", true, true, "--window _quake --profile \"Windows PowerShell\"")]
[DataRow("Windows PowerShell", false, true, "--window _quake --profile \"Windows PowerShell\"")]
[DataRow("Windows PowerShell", true, false, "--window 0 nt --profile \"Windows PowerShell\"")]
[DataRow("Windows PowerShell", true, false, "nt --profile \"Windows PowerShell\"")]
[DataRow("Windows PowerShell", false, false, " --profile \"Windows PowerShell\"")]
public void ArgumentsTest(string profile, bool openNewTab, bool openQuake, string expectedArguments)
{

View File

@@ -28,7 +28,7 @@ namespace Microsoft.PowerToys.Run.Plugin.WindowsTerminal.Helpers
}
else if (openNewTab)
{
argsPrefix = "--window 0 nt";
argsPrefix = "nt";
}
return $"{argsPrefix} --profile \"{profileName}\"";