undo some changes
This commit is contained in:
parent
d80a5f2ced
commit
d1a17ef356
2 changed files with 8 additions and 8 deletions
|
|
@ -292,7 +292,7 @@ impl PtyBus {
|
||||||
self.id_to_child_pid.insert(pid_primary, pid_secondary);
|
self.id_to_child_pid.insert(pid_primary, pid_secondary);
|
||||||
pid_primary
|
pid_primary
|
||||||
}
|
}
|
||||||
pub fn spawn_terminals_for_layout(&mut self, layout_path: PathBuf, err_ctx: ErrorContext) {
|
pub fn spawn_terminals_for_layout(&mut self, layout_path: PathBuf) {
|
||||||
let layout = Layout::new(layout_path.clone());
|
let layout = Layout::new(layout_path.clone());
|
||||||
let total_panes = layout.total_terminal_panes();
|
let total_panes = layout.total_terminal_panes();
|
||||||
let mut new_pane_pids = vec![];
|
let mut new_pane_pids = vec![];
|
||||||
|
|
@ -312,7 +312,7 @@ impl PtyBus {
|
||||||
self.task_handles.insert(id, task_handle);
|
self.task_handles.insert(id, task_handle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pub fn close_pane(&mut self, id: PaneId, err_ctx: ErrorContext) {
|
pub fn close_pane(&mut self, id: PaneId) {
|
||||||
match id {
|
match id {
|
||||||
PaneId::Terminal(id) => {
|
PaneId::Terminal(id) => {
|
||||||
let child_pid = self.id_to_child_pid.remove(&id).unwrap();
|
let child_pid = self.id_to_child_pid.remove(&id).unwrap();
|
||||||
|
|
@ -328,9 +328,9 @@ impl PtyBus {
|
||||||
.unwrap(),
|
.unwrap(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pub fn close_tab(&mut self, ids: Vec<PaneId>, err_ctx: ErrorContext) {
|
pub fn close_tab(&mut self, ids: Vec<PaneId>) {
|
||||||
ids.iter().for_each(|&id| {
|
ids.iter().for_each(|&id| {
|
||||||
self.close_pane(id, err_ctx);
|
self.close_pane(id);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -339,7 +339,7 @@ impl Drop for PtyBus {
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
let child_ids: Vec<RawFd> = self.id_to_child_pid.keys().copied().collect();
|
let child_ids: Vec<RawFd> = self.id_to_child_pid.keys().copied().collect();
|
||||||
for id in child_ids {
|
for id in child_ids {
|
||||||
self.close_pane(PaneId::Terminal(id), ErrorContext::new());
|
self.close_pane(PaneId::Terminal(id));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,7 @@ pub fn start_server(
|
||||||
}
|
}
|
||||||
PtyInstruction::NewTab => {
|
PtyInstruction::NewTab => {
|
||||||
if let Some(layout) = maybe_layout.clone() {
|
if let Some(layout) = maybe_layout.clone() {
|
||||||
pty_bus.spawn_terminals_for_layout(layout, err_ctx);
|
pty_bus.spawn_terminals_for_layout(layout);
|
||||||
} else {
|
} else {
|
||||||
let pid = pty_bus.spawn_terminal(None);
|
let pid = pty_bus.spawn_terminal(None);
|
||||||
pty_bus
|
pty_bus
|
||||||
|
|
@ -101,11 +101,11 @@ pub fn start_server(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
PtyInstruction::ClosePane(id) => {
|
PtyInstruction::ClosePane(id) => {
|
||||||
pty_bus.close_pane(id, err_ctx);
|
pty_bus.close_pane(id);
|
||||||
command_is_executing.done_closing_pane();
|
command_is_executing.done_closing_pane();
|
||||||
}
|
}
|
||||||
PtyInstruction::CloseTab(ids) => {
|
PtyInstruction::CloseTab(ids) => {
|
||||||
pty_bus.close_tab(ids, err_ctx);
|
pty_bus.close_tab(ids);
|
||||||
command_is_executing.done_closing_pane();
|
command_is_executing.done_closing_pane();
|
||||||
}
|
}
|
||||||
PtyInstruction::Quit => {
|
PtyInstruction::Quit => {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue