Terminal in debugger (#29328)

- **debug-terminal**
- **Use terminal inside debugger to spawn commands**

Closes #ISSUE

Release Notes:

- N/A
This commit is contained in:
Conrad Irwin 2025-04-24 14:26:09 -06:00 committed by GitHub
parent d3911e34de
commit c147daae4a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 255 additions and 170 deletions

View file

@ -9,7 +9,7 @@ use util::ResultExt;
use workspace::{Member, Pane, PaneAxis, Workspace};
use crate::session::running::{
self, RunningState, SubView, breakpoint_list::BreakpointList, console::Console,
self, DebugTerminal, RunningState, SubView, breakpoint_list::BreakpointList, console::Console,
loaded_source_list::LoadedSourceList, module_list::ModuleList,
stack_frame_list::StackFrameList, variable_list::VariableList,
};
@ -22,6 +22,7 @@ pub(crate) enum DebuggerPaneItem {
Frames,
Modules,
LoadedSources,
Terminal,
}
impl DebuggerPaneItem {
@ -33,6 +34,7 @@ impl DebuggerPaneItem {
DebuggerPaneItem::Frames,
DebuggerPaneItem::Modules,
DebuggerPaneItem::LoadedSources,
DebuggerPaneItem::Terminal,
];
VARIANTS
}
@ -55,6 +57,7 @@ impl DebuggerPaneItem {
DebuggerPaneItem::Frames => SharedString::new_static("Frames"),
DebuggerPaneItem::Modules => SharedString::new_static("Modules"),
DebuggerPaneItem::LoadedSources => SharedString::new_static("Sources"),
DebuggerPaneItem::Terminal => SharedString::new_static("Terminal"),
}
}
}
@ -169,6 +172,7 @@ pub(crate) fn deserialize_pane_layout(
console: &Entity<Console>,
breakpoint_list: &Entity<BreakpointList>,
loaded_sources: &Entity<LoadedSourceList>,
terminal: &Entity<DebugTerminal>,
subscriptions: &mut HashMap<EntityId, Subscription>,
window: &mut Window,
cx: &mut Context<RunningState>,
@ -191,6 +195,7 @@ pub(crate) fn deserialize_pane_layout(
console,
breakpoint_list,
loaded_sources,
terminal,
subscriptions,
window,
cx,
@ -273,6 +278,13 @@ pub(crate) fn deserialize_pane_layout(
})),
cx,
)),
DebuggerPaneItem::Terminal => Box::new(SubView::new(
pane.focus_handle(cx),
terminal.clone().into(),
DebuggerPaneItem::Terminal,
None,
cx,
)),
})
.collect();