cargo fmt
This commit is contained in:
parent
1a84c5f4ec
commit
6769627c36
3 changed files with 12 additions and 19 deletions
|
|
@ -596,22 +596,18 @@ impl Tab {
|
||||||
}
|
}
|
||||||
pub fn write_to_terminals_on_current_tab(&mut self, input_bytes: Vec<u8>) {
|
pub fn write_to_terminals_on_current_tab(&mut self, input_bytes: Vec<u8>) {
|
||||||
let pane_ids = self.get_pane_ids();
|
let pane_ids = self.get_pane_ids();
|
||||||
pane_ids.iter().for_each(|pane_id| {
|
pane_ids.iter().for_each(|pane_id| match pane_id {
|
||||||
match pane_id {
|
|
||||||
PaneId::Terminal(pid) => {
|
PaneId::Terminal(pid) => {
|
||||||
self.write_to_pane_id(input_bytes.clone(), *pid);
|
self.write_to_pane_id(input_bytes.clone(), *pid);
|
||||||
}
|
}
|
||||||
PaneId::Plugin(_) => {}
|
PaneId::Plugin(_) => {}
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
pub fn write_to_pane_id(&mut self, mut input_bytes: Vec<u8>, pid: RawFd) {
|
pub fn write_to_pane_id(&mut self, mut input_bytes: Vec<u8>, pid: RawFd) {
|
||||||
self.os_api
|
self.os_api
|
||||||
.write_to_tty_stdin(pid, &mut input_bytes)
|
.write_to_tty_stdin(pid, &mut input_bytes)
|
||||||
.expect("failed to write to terminal");
|
.expect("failed to write to terminal");
|
||||||
self.os_api
|
self.os_api.tcdrain(pid).expect("failed to drain terminal");
|
||||||
.tcdrain(pid)
|
|
||||||
.expect("failed to drain terminal");
|
|
||||||
}
|
}
|
||||||
pub fn write_to_active_terminal(&mut self, input_bytes: Vec<u8>) {
|
pub fn write_to_active_terminal(&mut self, input_bytes: Vec<u8>) {
|
||||||
match self.get_active_pane_id() {
|
match self.get_active_pane_id() {
|
||||||
|
|
|
||||||
|
|
@ -248,7 +248,6 @@ impl InputHandler {
|
||||||
self.send_screen_instructions
|
self.send_screen_instructions
|
||||||
.send(ScreenInstruction::ToggleActiveSyncPanes)
|
.send(ScreenInstruction::ToggleActiveSyncPanes)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
}
|
}
|
||||||
Action::CloseTab => {
|
Action::CloseTab => {
|
||||||
self.command_is_executing.closing_pane();
|
self.command_is_executing.closing_pane();
|
||||||
|
|
|
||||||
|
|
@ -323,8 +323,7 @@ pub fn start(mut os_input: Box<dyn OsApi>, opts: CliArgs) {
|
||||||
let active_tab = screen.get_active_tab_mut().unwrap();
|
let active_tab = screen.get_active_tab_mut().unwrap();
|
||||||
match active_tab.is_sync_panes_active() {
|
match active_tab.is_sync_panes_active() {
|
||||||
true => active_tab.write_to_terminals_on_current_tab(bytes),
|
true => active_tab.write_to_terminals_on_current_tab(bytes),
|
||||||
false => active_tab
|
false => active_tab.write_to_active_terminal(bytes),
|
||||||
.write_to_active_terminal(bytes),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ScreenInstruction::ResizeLeft => {
|
ScreenInstruction::ResizeLeft => {
|
||||||
|
|
@ -455,7 +454,6 @@ pub fn start(mut os_input: Box<dyn OsApi>, opts: CliArgs) {
|
||||||
ScreenInstruction::Quit => {
|
ScreenInstruction::Quit => {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue