WIP termial implementation. need some way of getting the currently valid workspace ID

This commit is contained in:
Mikayla Maki 2022-11-20 19:19:42 -08:00
parent a8ed95e1dc
commit e659823e6c
6 changed files with 84 additions and 55 deletions

View file

@ -33,11 +33,9 @@ use mappings::mouse::{
alt_scroll, grid_point, mouse_button_report, mouse_moved_report, mouse_side, scroll_report,
};
use persistence::TERMINAL_CONNECTION;
use procinfo::LocalProcessInfo;
use settings::{AlternateScroll, Settings, Shell, TerminalBlink};
use util::ResultExt;
use workspace::{ItemId, WorkspaceId};
use std::{
cmp::min,
@ -284,8 +282,6 @@ impl TerminalBuilder {
blink_settings: Option<TerminalBlink>,
alternate_scroll: &AlternateScroll,
window_id: usize,
item_id: ItemId,
workspace_id: WorkspaceId,
) -> Result<TerminalBuilder> {
let pty_config = {
let alac_shell = shell.clone().and_then(|shell| match shell {
@ -390,8 +386,6 @@ impl TerminalBuilder {
last_mouse_position: None,
next_link_id: 0,
selection_phase: SelectionPhase::Ended,
workspace_id,
item_id,
};
Ok(TerminalBuilder {
@ -535,8 +529,6 @@ pub struct Terminal {
scroll_px: f32,
next_link_id: usize,
selection_phase: SelectionPhase,
item_id: ItemId,
workspace_id: WorkspaceId,
}
impl Terminal {
@ -578,15 +570,15 @@ impl Terminal {
if self.update_process_info() {
cx.emit(Event::TitleChanged);
if let Some(foreground_info) = self.foreground_process_info {
cx.background().spawn(async move {
TERMINAL_CONNECTION.save_working_directory(
self.item_id,
&self.workspace_id,
&foreground_info.cwd,
);
});
}
// if let Some(foreground_info) = self.foreground_process_info {
// cx.background().spawn(async move {
// TERMINAL_CONNECTION.save_working_directory(
// self.item_id,
// &self.workspace_id,
// &foreground_info.cwd,
// );
// });
// }
}
}
AlacTermEvent::ColorRequest(idx, fun_ptr) => {