fix(ui): keep ConPTY sessions alive across Mission Control layout rebuilds
TerminalView kills its child process on any logical-tree detach unless BeginReparent() suppressed it, and RebuildOverviewGrid() detaches every existing pane whenever one is added - so opening a second interactive session killed the first. Focus-mode tab switches had the same defect. PtyTerminalSession now puts the control in permanent reparent mode after launch (teardown stays explicit via ConPtyPaneViewModel.Dispose -> Kill), and the new ConPtyPaneHost reparents each pane's single long-lived view across grid rebuilds and tab switches instead of letting the DataTemplate instantiate a dead replacement.
This commit is contained in:
@@ -46,6 +46,13 @@ public sealed class PtyTerminalSession : IDisposable
|
||||
control.StartingDirectory = descriptor.Cwd;
|
||||
|
||||
await control.LaunchProcess();
|
||||
|
||||
// Permanent reparent mode: TerminalView.OnDetachedFromLogicalTree kills the child
|
||||
// process unless BeginReparent() suppressed it, and Mission Control detaches pane
|
||||
// views routinely (overview-grid rebuilds on pane add/remove, focus-mode tab
|
||||
// switches). ClaudeDo owns teardown explicitly instead — ConPtyPaneViewModel.Dispose
|
||||
// calls Kill() when a pane closes — so EndReparent is deliberately never called.
|
||||
control.BeginReparent();
|
||||
IsRunning = true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user