fix(logs): suppress debug logs when not debugging (#2532)
* fix(logs): suppress debug logs when not debugging * fix(tests): add debug flag to constructor
This commit is contained in:
parent
603eeb4c58
commit
3d82a2f5ac
15 changed files with 309 additions and 5 deletions
|
|
@ -189,6 +189,7 @@ fn read_from_channel(
|
|||
width: 8,
|
||||
})));
|
||||
let sixel_image_store = Rc::new(RefCell::new(SixelImageStore::default()));
|
||||
let debug = false;
|
||||
let mut terminal_output = TerminalPane::new(
|
||||
0,
|
||||
pane_geom,
|
||||
|
|
@ -202,6 +203,7 @@ fn read_from_channel(
|
|||
Rc::new(RefCell::new(HashMap::new())),
|
||||
None,
|
||||
None,
|
||||
debug,
|
||||
); // 0 is the pane index
|
||||
loop {
|
||||
if !should_keep_running.load(Ordering::SeqCst) {
|
||||
|
|
|
|||
|
|
@ -749,12 +749,14 @@ fn init_session(
|
|||
let max_panes = opts.max_panes;
|
||||
|
||||
let client_attributes_clone = client_attributes.clone();
|
||||
let debug = opts.debug;
|
||||
move || {
|
||||
screen_thread_main(
|
||||
screen_bus,
|
||||
max_panes,
|
||||
client_attributes_clone,
|
||||
config_options,
|
||||
debug,
|
||||
)
|
||||
.fatal();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -370,6 +370,7 @@ pub struct Grid {
|
|||
pub focus_event_tracking: bool,
|
||||
pub search_results: SearchResult,
|
||||
pub pending_clipboard_update: Option<String>,
|
||||
debug: bool,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
|
|
@ -457,6 +458,7 @@ impl Grid {
|
|||
link_handler: Rc<RefCell<LinkHandler>>,
|
||||
character_cell_size: Rc<RefCell<Option<SizeInPixels>>>,
|
||||
sixel_image_store: Rc<RefCell<SixelImageStore>>,
|
||||
debug: bool,
|
||||
) -> Self {
|
||||
let sixel_grid = SixelGrid::new(character_cell_size.clone(), sixel_image_store);
|
||||
Grid {
|
||||
|
|
@ -505,6 +507,7 @@ impl Grid {
|
|||
search_results: Default::default(),
|
||||
sixel_grid,
|
||||
pending_clipboard_update: None,
|
||||
debug,
|
||||
}
|
||||
}
|
||||
pub fn render_full_viewport(&mut self) {
|
||||
|
|
@ -2157,7 +2160,9 @@ impl Perform for Grid {
|
|||
self.set_active_charset(CharsetIndex::G0);
|
||||
},
|
||||
_ => {
|
||||
log::warn!("Unhandled execute: {:?}", byte);
|
||||
if self.debug {
|
||||
log::warn!("Unhandled execute: {:?}", byte);
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
@ -2386,7 +2391,9 @@ impl Perform for Grid {
|
|||
},
|
||||
|
||||
_ => {
|
||||
log::warn!("Unhandled osc: {:?}", params);
|
||||
if self.debug {
|
||||
log::warn!("Unhandled osc: {:?}", params);
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
@ -2912,7 +2919,9 @@ impl Perform for Grid {
|
|||
_ => {},
|
||||
}
|
||||
} else {
|
||||
log::warn!("Unhandled csi: {}->{:?}", c, params);
|
||||
if self.debug {
|
||||
log::warn!("Unhandled csi: {}->{:?}", c, params);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2994,7 +3003,9 @@ impl Perform for Grid {
|
|||
self.fill_viewport(fill_character);
|
||||
},
|
||||
_ => {
|
||||
log::warn!("Unhandled esc_dispatch: {}->{:?}", byte, intermediates);
|
||||
if self.debug {
|
||||
log::warn!("Unhandled esc_dispatch: {}->{:?}", byte, intermediates);
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ macro_rules! get_or_create_grid {
|
|||
$self.link_handler.clone(),
|
||||
$self.character_cell_size.clone(),
|
||||
$self.sixel_image_store.clone(),
|
||||
$self.debug,
|
||||
);
|
||||
grid.hide_cursor();
|
||||
grid
|
||||
|
|
@ -72,6 +73,7 @@ pub(crate) struct PluginPane {
|
|||
pane_frame_color_override: Option<(PaletteColor, Option<String>)>,
|
||||
invoked_with: Option<Run>,
|
||||
loading_indication: LoadingIndication,
|
||||
debug: bool,
|
||||
}
|
||||
|
||||
impl PluginPane {
|
||||
|
|
@ -89,6 +91,7 @@ impl PluginPane {
|
|||
currently_connected_clients: Vec<ClientId>,
|
||||
style: Style,
|
||||
invoked_with: Option<Run>,
|
||||
debug: bool,
|
||||
) -> Self {
|
||||
let loading_indication = LoadingIndication::new(title.clone()).with_colors(style.colors);
|
||||
let initial_loading_message = loading_indication.to_string();
|
||||
|
|
@ -118,6 +121,7 @@ impl PluginPane {
|
|||
pane_frame_color_override: None,
|
||||
invoked_with,
|
||||
loading_indication,
|
||||
debug,
|
||||
};
|
||||
for client_id in currently_connected_clients {
|
||||
plugin.handle_plugin_bytes(client_id, initial_loading_message.as_bytes().to_vec());
|
||||
|
|
|
|||
|
|
@ -398,7 +398,6 @@ impl CharacterStyles {
|
|||
*self = self.background(Some(AnsiCode::NamedColor(NamedColor::BrightWhite)))
|
||||
},
|
||||
_ => {
|
||||
log::warn!("unhandled csi m code {:?}", param);
|
||||
return;
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -737,6 +737,7 @@ impl TerminalPane {
|
|||
terminal_emulator_color_codes: Rc<RefCell<HashMap<usize, String>>>,
|
||||
initial_pane_title: Option<String>,
|
||||
invoked_with: Option<Run>,
|
||||
debug: bool,
|
||||
) -> TerminalPane {
|
||||
let initial_pane_title =
|
||||
initial_pane_title.unwrap_or_else(|| format!("Pane #{}", pane_index));
|
||||
|
|
@ -748,6 +749,7 @@ impl TerminalPane {
|
|||
link_handler,
|
||||
character_cell_size,
|
||||
sixel_image_store,
|
||||
debug,
|
||||
);
|
||||
TerminalPane {
|
||||
frame: HashMap::new(),
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -28,6 +28,7 @@ fn create_pane() -> TerminalPane {
|
|||
let style = Style::default();
|
||||
let sixel_image_store = Rc::new(RefCell::new(SixelImageStore::default()));
|
||||
let terminal_emulator_color_codes = Rc::new(RefCell::new(HashMap::new()));
|
||||
let debug = false;
|
||||
let mut terminal_pane = TerminalPane::new(
|
||||
pid,
|
||||
fake_win_size,
|
||||
|
|
@ -41,6 +42,7 @@ fn create_pane() -> TerminalPane {
|
|||
terminal_emulator_color_codes,
|
||||
None,
|
||||
None,
|
||||
debug,
|
||||
); // 0 is the pane index
|
||||
let content = read_fixture();
|
||||
terminal_pane.handle_pty_bytes(content);
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ pub fn scrolling_inside_a_pane() {
|
|||
let sixel_image_store = Rc::new(RefCell::new(SixelImageStore::default()));
|
||||
let terminal_emulator_colors = Rc::new(RefCell::new(Palette::default()));
|
||||
let terminal_emulator_color_codes = Rc::new(RefCell::new(HashMap::new()));
|
||||
let debug = false;
|
||||
let mut terminal_pane = TerminalPane::new(
|
||||
pid,
|
||||
fake_win_size,
|
||||
|
|
@ -49,6 +50,7 @@ pub fn scrolling_inside_a_pane() {
|
|||
terminal_emulator_color_codes,
|
||||
None,
|
||||
None,
|
||||
debug,
|
||||
); // 0 is the pane index
|
||||
let mut text_to_fill_pane = String::new();
|
||||
for i in 0..30 {
|
||||
|
|
@ -78,6 +80,7 @@ pub fn sixel_image_inside_terminal_pane() {
|
|||
width: 8,
|
||||
height: 21,
|
||||
})));
|
||||
let debug = false;
|
||||
let mut terminal_pane = TerminalPane::new(
|
||||
pid,
|
||||
fake_win_size,
|
||||
|
|
@ -91,6 +94,7 @@ pub fn sixel_image_inside_terminal_pane() {
|
|||
terminal_emulator_color_codes,
|
||||
None,
|
||||
None,
|
||||
debug,
|
||||
); // 0 is the pane index
|
||||
let sixel_image_bytes = "\u{1b}Pq
|
||||
#0;2;0;0;0#1;2;100;100;0#2;2;0;100;0
|
||||
|
|
@ -120,6 +124,7 @@ pub fn partial_sixel_image_inside_terminal_pane() {
|
|||
width: 8,
|
||||
height: 21,
|
||||
})));
|
||||
let debug = false;
|
||||
let mut terminal_pane = TerminalPane::new(
|
||||
pid,
|
||||
fake_win_size,
|
||||
|
|
@ -133,6 +138,7 @@ pub fn partial_sixel_image_inside_terminal_pane() {
|
|||
terminal_emulator_color_codes,
|
||||
None,
|
||||
None,
|
||||
debug,
|
||||
); // 0 is the pane index
|
||||
let pane_content = read_fixture("sixel-image-500px.six");
|
||||
terminal_pane.handle_pty_bytes(pane_content);
|
||||
|
|
@ -156,6 +162,7 @@ pub fn overflowing_sixel_image_inside_terminal_pane() {
|
|||
width: 8,
|
||||
height: 21,
|
||||
})));
|
||||
let debug = false;
|
||||
let mut terminal_pane = TerminalPane::new(
|
||||
pid,
|
||||
fake_win_size,
|
||||
|
|
@ -169,6 +176,7 @@ pub fn overflowing_sixel_image_inside_terminal_pane() {
|
|||
terminal_emulator_color_codes,
|
||||
None,
|
||||
None,
|
||||
debug,
|
||||
); // 0 is the pane index
|
||||
let pane_content = read_fixture("sixel-image-500px.six");
|
||||
terminal_pane.handle_pty_bytes(pane_content);
|
||||
|
|
@ -191,6 +199,7 @@ pub fn scrolling_through_a_sixel_image() {
|
|||
width: 8,
|
||||
height: 21,
|
||||
})));
|
||||
let debug = false;
|
||||
let mut terminal_pane = TerminalPane::new(
|
||||
pid,
|
||||
fake_win_size,
|
||||
|
|
@ -204,6 +213,7 @@ pub fn scrolling_through_a_sixel_image() {
|
|||
terminal_emulator_color_codes,
|
||||
None,
|
||||
None,
|
||||
debug,
|
||||
); // 0 is the pane index
|
||||
let mut text_to_fill_pane = String::new();
|
||||
for i in 0..30 {
|
||||
|
|
@ -237,6 +247,7 @@ pub fn multiple_sixel_images_in_pane() {
|
|||
width: 8,
|
||||
height: 21,
|
||||
})));
|
||||
let debug = false;
|
||||
let mut terminal_pane = TerminalPane::new(
|
||||
pid,
|
||||
fake_win_size,
|
||||
|
|
@ -250,6 +261,7 @@ pub fn multiple_sixel_images_in_pane() {
|
|||
terminal_emulator_color_codes,
|
||||
None,
|
||||
None,
|
||||
debug,
|
||||
); // 0 is the pane index
|
||||
let mut text_to_fill_pane = String::new();
|
||||
for i in 0..5 {
|
||||
|
|
@ -281,6 +293,7 @@ pub fn resizing_pane_with_sixel_images() {
|
|||
width: 8,
|
||||
height: 21,
|
||||
})));
|
||||
let debug = false;
|
||||
let mut terminal_pane = TerminalPane::new(
|
||||
pid,
|
||||
fake_win_size,
|
||||
|
|
@ -294,6 +307,7 @@ pub fn resizing_pane_with_sixel_images() {
|
|||
terminal_emulator_color_codes,
|
||||
None,
|
||||
None,
|
||||
debug,
|
||||
); // 0 is the pane index
|
||||
let mut text_to_fill_pane = String::new();
|
||||
for i in 0..5 {
|
||||
|
|
@ -328,6 +342,7 @@ pub fn changing_character_cell_size_with_sixel_images() {
|
|||
width: 8,
|
||||
height: 21,
|
||||
})));
|
||||
let debug = false;
|
||||
let mut terminal_pane = TerminalPane::new(
|
||||
pid,
|
||||
fake_win_size,
|
||||
|
|
@ -341,6 +356,7 @@ pub fn changing_character_cell_size_with_sixel_images() {
|
|||
terminal_emulator_color_codes,
|
||||
None,
|
||||
None,
|
||||
debug,
|
||||
); // 0 is the pane index
|
||||
let mut text_to_fill_pane = String::new();
|
||||
for i in 0..5 {
|
||||
|
|
@ -380,6 +396,7 @@ pub fn keep_working_after_corrupted_sixel_image() {
|
|||
width: 8,
|
||||
height: 21,
|
||||
})));
|
||||
let debug = false;
|
||||
let mut terminal_pane = TerminalPane::new(
|
||||
pid,
|
||||
fake_win_size,
|
||||
|
|
@ -393,6 +410,7 @@ pub fn keep_working_after_corrupted_sixel_image() {
|
|||
terminal_emulator_color_codes,
|
||||
None,
|
||||
None,
|
||||
debug,
|
||||
); // 0 is the pane index
|
||||
|
||||
let sixel_image_bytes = "\u{1b}PI AM CORRUPTED BWAHAHAq
|
||||
|
|
@ -430,6 +448,7 @@ pub fn pane_with_frame_position_is_on_frame() {
|
|||
width: 8,
|
||||
height: 21,
|
||||
})));
|
||||
let debug = false;
|
||||
let mut terminal_pane = TerminalPane::new(
|
||||
pid,
|
||||
fake_win_size,
|
||||
|
|
@ -443,6 +462,7 @@ pub fn pane_with_frame_position_is_on_frame() {
|
|||
terminal_emulator_color_codes,
|
||||
None,
|
||||
None,
|
||||
debug,
|
||||
); // 0 is the pane index
|
||||
|
||||
terminal_pane.set_content_offset(Offset::frame(1));
|
||||
|
|
@ -516,6 +536,7 @@ pub fn pane_with_bottom_and_right_borders_position_is_on_frame() {
|
|||
width: 8,
|
||||
height: 21,
|
||||
})));
|
||||
let debug = false;
|
||||
let mut terminal_pane = TerminalPane::new(
|
||||
pid,
|
||||
fake_win_size,
|
||||
|
|
@ -529,6 +550,7 @@ pub fn pane_with_bottom_and_right_borders_position_is_on_frame() {
|
|||
terminal_emulator_color_codes,
|
||||
None,
|
||||
None,
|
||||
debug,
|
||||
); // 0 is the pane index
|
||||
|
||||
terminal_pane.set_content_offset(Offset::shift(1, 1));
|
||||
|
|
@ -602,6 +624,7 @@ pub fn frameless_pane_position_is_on_frame() {
|
|||
width: 8,
|
||||
height: 21,
|
||||
})));
|
||||
let debug = false;
|
||||
let mut terminal_pane = TerminalPane::new(
|
||||
pid,
|
||||
fake_win_size,
|
||||
|
|
@ -615,6 +638,7 @@ pub fn frameless_pane_position_is_on_frame() {
|
|||
terminal_emulator_color_codes,
|
||||
None,
|
||||
None,
|
||||
debug,
|
||||
); // 0 is the pane index
|
||||
|
||||
terminal_pane.set_content_offset(Offset::default());
|
||||
|
|
|
|||
|
|
@ -502,6 +502,7 @@ pub(crate) struct Screen {
|
|||
auto_layout: bool,
|
||||
session_is_mirrored: bool,
|
||||
copy_options: CopyOptions,
|
||||
debug: bool,
|
||||
}
|
||||
|
||||
impl Screen {
|
||||
|
|
@ -515,6 +516,7 @@ impl Screen {
|
|||
auto_layout: bool,
|
||||
session_is_mirrored: bool,
|
||||
copy_options: CopyOptions,
|
||||
debug: bool,
|
||||
) -> Self {
|
||||
Screen {
|
||||
bus,
|
||||
|
|
@ -537,6 +539,7 @@ impl Screen {
|
|||
auto_layout,
|
||||
session_is_mirrored,
|
||||
copy_options,
|
||||
debug,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1055,6 +1058,7 @@ impl Screen {
|
|||
self.terminal_emulator_colors.clone(),
|
||||
self.terminal_emulator_color_codes.clone(),
|
||||
swap_layouts,
|
||||
self.debug,
|
||||
);
|
||||
self.tabs.insert(tab_index, tab);
|
||||
Ok(())
|
||||
|
|
@ -1510,6 +1514,7 @@ pub(crate) fn screen_thread_main(
|
|||
max_panes: Option<usize>,
|
||||
client_attributes: ClientAttributes,
|
||||
config_options: Box<Options>,
|
||||
debug: bool,
|
||||
) -> Result<()> {
|
||||
let capabilities = config_options.simplified_ui;
|
||||
let draw_pane_frames = config_options.pane_frames.unwrap_or(true);
|
||||
|
|
@ -1536,6 +1541,7 @@ pub(crate) fn screen_thread_main(
|
|||
auto_layout,
|
||||
session_is_mirrored,
|
||||
copy_options,
|
||||
debug,
|
||||
);
|
||||
|
||||
let mut pending_tab_ids: HashSet<usize> = HashSet::new();
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ pub struct LayoutApplier<'a> {
|
|||
draw_pane_frames: bool,
|
||||
focus_pane_id: &'a mut Option<PaneId>,
|
||||
os_api: Box<dyn ServerOsApi>,
|
||||
debug: bool,
|
||||
}
|
||||
|
||||
impl<'a> LayoutApplier<'a> {
|
||||
|
|
@ -57,6 +58,7 @@ impl<'a> LayoutApplier<'a> {
|
|||
draw_pane_frames: bool,
|
||||
focus_pane_id: &'a mut Option<PaneId>,
|
||||
os_api: &Box<dyn ServerOsApi>,
|
||||
debug: bool,
|
||||
) -> Self {
|
||||
let viewport = viewport.clone();
|
||||
let senders = senders.clone();
|
||||
|
|
@ -85,6 +87,7 @@ impl<'a> LayoutApplier<'a> {
|
|||
draw_pane_frames,
|
||||
focus_pane_id,
|
||||
os_api,
|
||||
debug,
|
||||
}
|
||||
}
|
||||
pub fn apply_layout(
|
||||
|
|
@ -233,6 +236,7 @@ impl<'a> LayoutApplier<'a> {
|
|||
self.connected_clients.borrow().iter().copied().collect(),
|
||||
self.style,
|
||||
layout.run.clone(),
|
||||
self.debug,
|
||||
);
|
||||
new_plugin.set_borderless(layout.borderless);
|
||||
if let Some(exclude_from_sync) = layout.exclude_from_sync {
|
||||
|
|
@ -263,6 +267,7 @@ impl<'a> LayoutApplier<'a> {
|
|||
self.terminal_emulator_color_codes.clone(),
|
||||
initial_title,
|
||||
layout.run.clone(),
|
||||
self.debug,
|
||||
);
|
||||
new_pane.set_borderless(layout.borderless);
|
||||
if let Some(exclude_from_sync) = layout.exclude_from_sync {
|
||||
|
|
@ -342,6 +347,7 @@ impl<'a> LayoutApplier<'a> {
|
|||
self.connected_clients.borrow().iter().copied().collect(),
|
||||
self.style,
|
||||
floating_pane_layout.run.clone(),
|
||||
self.debug,
|
||||
);
|
||||
new_pane.set_borderless(false);
|
||||
new_pane.set_content_offset(Offset::frame(1));
|
||||
|
|
@ -379,6 +385,7 @@ impl<'a> LayoutApplier<'a> {
|
|||
self.terminal_emulator_color_codes.clone(),
|
||||
initial_title,
|
||||
floating_pane_layout.run.clone(),
|
||||
self.debug,
|
||||
);
|
||||
new_pane.set_borderless(false);
|
||||
new_pane.set_content_offset(Offset::frame(1));
|
||||
|
|
|
|||
|
|
@ -170,6 +170,7 @@ pub(crate) struct Tab {
|
|||
pending_instructions: Vec<BufferedTabInstruction>, // instructions that came while the tab was
|
||||
// pending and need to be re-applied
|
||||
swap_layouts: SwapLayouts,
|
||||
debug: bool,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Default, Serialize, Deserialize)]
|
||||
|
|
@ -498,6 +499,7 @@ impl Tab {
|
|||
terminal_emulator_colors: Rc<RefCell<Palette>>,
|
||||
terminal_emulator_color_codes: Rc<RefCell<HashMap<usize, String>>>,
|
||||
swap_layouts: (Vec<SwapTiledLayout>, Vec<SwapFloatingLayout>),
|
||||
debug: bool,
|
||||
) -> Self {
|
||||
let name = if name.is_empty() {
|
||||
format!("Tab #{}", index + 1)
|
||||
|
|
@ -584,6 +586,7 @@ impl Tab {
|
|||
is_pending: true, // will be switched to false once the layout is applied
|
||||
pending_instructions: vec![],
|
||||
swap_layouts,
|
||||
debug,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -614,6 +617,7 @@ impl Tab {
|
|||
self.draw_pane_frames,
|
||||
&mut self.focus_pane_id,
|
||||
&self.os_api,
|
||||
self.debug,
|
||||
)
|
||||
.apply_layout(
|
||||
layout,
|
||||
|
|
@ -673,6 +677,7 @@ impl Tab {
|
|||
self.draw_pane_frames,
|
||||
&mut self.focus_pane_id,
|
||||
&self.os_api,
|
||||
self.debug,
|
||||
)
|
||||
.apply_floating_panes_layout_to_existing_panes(
|
||||
&layout_candidate,
|
||||
|
|
@ -726,6 +731,7 @@ impl Tab {
|
|||
self.draw_pane_frames,
|
||||
&mut self.focus_pane_id,
|
||||
&self.os_api,
|
||||
self.debug,
|
||||
)
|
||||
.apply_tiled_panes_layout_to_existing_panes(
|
||||
&layout_candidate,
|
||||
|
|
@ -1013,6 +1019,7 @@ impl Tab {
|
|||
self.terminal_emulator_color_codes.clone(),
|
||||
initial_pane_title,
|
||||
None,
|
||||
self.debug,
|
||||
)) as Box<dyn Pane>
|
||||
},
|
||||
PaneId::Plugin(plugin_pid) => {
|
||||
|
|
@ -1034,6 +1041,7 @@ impl Tab {
|
|||
self.connected_clients.borrow().iter().copied().collect(),
|
||||
self.style,
|
||||
run_plugin,
|
||||
self.debug,
|
||||
)) as Box<dyn Pane>
|
||||
},
|
||||
};
|
||||
|
|
@ -1065,6 +1073,7 @@ impl Tab {
|
|||
self.terminal_emulator_color_codes.clone(),
|
||||
None,
|
||||
None,
|
||||
self.debug,
|
||||
);
|
||||
new_pane.update_name("EDITING SCROLLBACK"); // we do this here and not in the
|
||||
// constructor so it won't be overrided
|
||||
|
|
@ -1140,6 +1149,7 @@ impl Tab {
|
|||
self.terminal_emulator_color_codes.clone(),
|
||||
initial_pane_title,
|
||||
None,
|
||||
self.debug,
|
||||
);
|
||||
self.tiled_panes
|
||||
.split_pane_horizontally(pid, Box::new(new_terminal), client_id);
|
||||
|
|
@ -1196,6 +1206,7 @@ impl Tab {
|
|||
self.terminal_emulator_color_codes.clone(),
|
||||
initial_pane_title,
|
||||
None,
|
||||
self.debug,
|
||||
);
|
||||
self.tiled_panes
|
||||
.split_pane_vertically(pid, Box::new(new_terminal), client_id);
|
||||
|
|
|
|||
|
|
@ -222,6 +222,7 @@ fn create_new_tab(size: Size, default_mode: ModeInfo) -> Tab {
|
|||
let copy_options = CopyOptions::default();
|
||||
let terminal_emulator_color_codes = Rc::new(RefCell::new(HashMap::new()));
|
||||
let sixel_image_store = Rc::new(RefCell::new(SixelImageStore::default()));
|
||||
let debug = false;
|
||||
let mut tab = Tab::new(
|
||||
index,
|
||||
position,
|
||||
|
|
@ -243,6 +244,7 @@ fn create_new_tab(size: Size, default_mode: ModeInfo) -> Tab {
|
|||
terminal_emulator_colors,
|
||||
terminal_emulator_color_codes,
|
||||
(vec![], vec![]),
|
||||
debug,
|
||||
);
|
||||
tab.apply_layout(
|
||||
TiledPaneLayout::default(),
|
||||
|
|
@ -292,6 +294,7 @@ fn create_new_tab_with_swap_layouts(
|
|||
let copy_options = CopyOptions::default();
|
||||
let terminal_emulator_color_codes = Rc::new(RefCell::new(HashMap::new()));
|
||||
let sixel_image_store = Rc::new(RefCell::new(SixelImageStore::default()));
|
||||
let debug = false;
|
||||
let mut tab = Tab::new(
|
||||
index,
|
||||
position,
|
||||
|
|
@ -313,6 +316,7 @@ fn create_new_tab_with_swap_layouts(
|
|||
terminal_emulator_colors,
|
||||
terminal_emulator_color_codes,
|
||||
swap_layouts,
|
||||
debug,
|
||||
);
|
||||
let (
|
||||
base_layout,
|
||||
|
|
@ -364,6 +368,7 @@ fn create_new_tab_with_os_api(
|
|||
let copy_options = CopyOptions::default();
|
||||
let terminal_emulator_color_codes = Rc::new(RefCell::new(HashMap::new()));
|
||||
let sixel_image_store = Rc::new(RefCell::new(SixelImageStore::default()));
|
||||
let debug = false;
|
||||
let mut tab = Tab::new(
|
||||
index,
|
||||
position,
|
||||
|
|
@ -385,6 +390,7 @@ fn create_new_tab_with_os_api(
|
|||
terminal_emulator_colors,
|
||||
terminal_emulator_color_codes,
|
||||
(vec![], vec![]), // swap layouts
|
||||
debug,
|
||||
);
|
||||
tab.apply_layout(
|
||||
TiledPaneLayout::default(),
|
||||
|
|
@ -422,6 +428,7 @@ fn create_new_tab_with_layout(size: Size, default_mode: ModeInfo, layout: &str)
|
|||
let sixel_image_store = Rc::new(RefCell::new(SixelImageStore::default()));
|
||||
let layout = Layout::from_str(layout, "layout_file_name".into(), None, None).unwrap();
|
||||
let (tab_layout, floating_panes_layout) = layout.new_tab();
|
||||
let debug = false;
|
||||
let mut tab = Tab::new(
|
||||
index,
|
||||
position,
|
||||
|
|
@ -443,6 +450,7 @@ fn create_new_tab_with_layout(size: Size, default_mode: ModeInfo, layout: &str)
|
|||
terminal_emulator_colors,
|
||||
terminal_emulator_color_codes,
|
||||
(vec![], vec![]), // swap layouts
|
||||
debug,
|
||||
);
|
||||
let pane_ids = tab_layout
|
||||
.extract_run_instructions()
|
||||
|
|
@ -494,6 +502,7 @@ fn create_new_tab_with_mock_pty_writer(
|
|||
let copy_options = CopyOptions::default();
|
||||
let terminal_emulator_color_codes = Rc::new(RefCell::new(HashMap::new()));
|
||||
let sixel_image_store = Rc::new(RefCell::new(SixelImageStore::default()));
|
||||
let debug = false;
|
||||
let mut tab = Tab::new(
|
||||
index,
|
||||
position,
|
||||
|
|
@ -515,6 +524,7 @@ fn create_new_tab_with_mock_pty_writer(
|
|||
terminal_emulator_colors,
|
||||
terminal_emulator_color_codes,
|
||||
(vec![], vec![]), // swap layouts
|
||||
debug,
|
||||
);
|
||||
tab.apply_layout(
|
||||
TiledPaneLayout::default(),
|
||||
|
|
@ -557,6 +567,7 @@ fn create_new_tab_with_sixel_support(
|
|||
let terminal_emulator_colors = Rc::new(RefCell::new(Palette::default()));
|
||||
let copy_options = CopyOptions::default();
|
||||
let terminal_emulator_color_codes = Rc::new(RefCell::new(HashMap::new()));
|
||||
let debug = false;
|
||||
let mut tab = Tab::new(
|
||||
index,
|
||||
position,
|
||||
|
|
@ -578,6 +589,7 @@ fn create_new_tab_with_sixel_support(
|
|||
terminal_emulator_colors,
|
||||
terminal_emulator_color_codes,
|
||||
(vec![], vec![]), // swap layouts
|
||||
debug,
|
||||
);
|
||||
tab.apply_layout(
|
||||
TiledPaneLayout::default(),
|
||||
|
|
@ -613,6 +625,7 @@ fn take_snapshot(ansi_instructions: &str, rows: usize, columns: usize, palette:
|
|||
width: 8,
|
||||
height: 21,
|
||||
})));
|
||||
let debug = false;
|
||||
let mut grid = Grid::new(
|
||||
rows,
|
||||
columns,
|
||||
|
|
@ -621,6 +634,7 @@ fn take_snapshot(ansi_instructions: &str, rows: usize, columns: usize, palette:
|
|||
Rc::new(RefCell::new(LinkHandler::new())),
|
||||
character_cell_size,
|
||||
sixel_image_store,
|
||||
debug,
|
||||
);
|
||||
let mut vte_parser = vte::Parser::new();
|
||||
for &byte in ansi_instructions.as_bytes() {
|
||||
|
|
@ -641,6 +655,7 @@ fn take_snapshot_with_sixel(
|
|||
width: 8,
|
||||
height: 21,
|
||||
})));
|
||||
let debug = false;
|
||||
let mut grid = Grid::new(
|
||||
rows,
|
||||
columns,
|
||||
|
|
@ -649,6 +664,7 @@ fn take_snapshot_with_sixel(
|
|||
Rc::new(RefCell::new(LinkHandler::new())),
|
||||
character_cell_size,
|
||||
sixel_image_store,
|
||||
debug,
|
||||
);
|
||||
let mut vte_parser = vte::Parser::new();
|
||||
for &byte in ansi_instructions.as_bytes() {
|
||||
|
|
@ -666,6 +682,7 @@ fn take_snapshot_and_cursor_position(
|
|||
// snapshot, x_coordinates, y_coordinates
|
||||
let sixel_image_store = Rc::new(RefCell::new(SixelImageStore::default()));
|
||||
let terminal_emulator_color_codes = Rc::new(RefCell::new(HashMap::new()));
|
||||
let debug = false;
|
||||
let mut grid = Grid::new(
|
||||
rows,
|
||||
columns,
|
||||
|
|
@ -674,6 +691,7 @@ fn take_snapshot_and_cursor_position(
|
|||
Rc::new(RefCell::new(LinkHandler::new())),
|
||||
Rc::new(RefCell::new(None)),
|
||||
sixel_image_store,
|
||||
debug,
|
||||
);
|
||||
let mut vte_parser = vte::Parser::new();
|
||||
for &byte in ansi_instructions.as_bytes() {
|
||||
|
|
|
|||
|
|
@ -164,6 +164,7 @@ fn create_new_tab(size: Size) -> Tab {
|
|||
let copy_options = CopyOptions::default();
|
||||
let sixel_image_store = Rc::new(RefCell::new(SixelImageStore::default()));
|
||||
let terminal_emulator_color_codes = Rc::new(RefCell::new(HashMap::new()));
|
||||
let debug = false;
|
||||
let mut tab = Tab::new(
|
||||
index,
|
||||
position,
|
||||
|
|
@ -185,6 +186,7 @@ fn create_new_tab(size: Size) -> Tab {
|
|||
terminal_emulator_colors,
|
||||
terminal_emulator_color_codes,
|
||||
(vec![], vec![]), // swap layouts
|
||||
debug,
|
||||
);
|
||||
tab.apply_layout(
|
||||
TiledPaneLayout::default(),
|
||||
|
|
@ -219,6 +221,7 @@ fn create_new_tab_with_layout(size: Size, layout: TiledPaneLayout) -> Tab {
|
|||
let copy_options = CopyOptions::default();
|
||||
let sixel_image_store = Rc::new(RefCell::new(SixelImageStore::default()));
|
||||
let terminal_emulator_color_codes = Rc::new(RefCell::new(HashMap::new()));
|
||||
let debug = false;
|
||||
let mut tab = Tab::new(
|
||||
index,
|
||||
position,
|
||||
|
|
@ -240,6 +243,7 @@ fn create_new_tab_with_layout(size: Size, layout: TiledPaneLayout) -> Tab {
|
|||
terminal_emulator_colors,
|
||||
terminal_emulator_color_codes,
|
||||
(vec![], vec![]), // swap layouts
|
||||
debug,
|
||||
);
|
||||
let mut new_terminal_ids = vec![];
|
||||
for i in 0..layout.extract_run_instructions().len() {
|
||||
|
|
@ -280,6 +284,7 @@ fn create_new_tab_with_cell_size(
|
|||
let copy_options = CopyOptions::default();
|
||||
let sixel_image_store = Rc::new(RefCell::new(SixelImageStore::default()));
|
||||
let terminal_emulator_color_codes = Rc::new(RefCell::new(HashMap::new()));
|
||||
let debug = false;
|
||||
let mut tab = Tab::new(
|
||||
index,
|
||||
position,
|
||||
|
|
@ -301,6 +306,7 @@ fn create_new_tab_with_cell_size(
|
|||
terminal_emulator_colors,
|
||||
terminal_emulator_color_codes,
|
||||
(vec![], vec![]), // swap layouts
|
||||
debug,
|
||||
);
|
||||
tab.apply_layout(
|
||||
TiledPaneLayout::default(),
|
||||
|
|
|
|||
|
|
@ -66,6 +66,7 @@ fn take_snapshots_and_cursor_coordinates_from_render_events<'a>(
|
|||
width: 8,
|
||||
height: 21,
|
||||
})));
|
||||
let debug = false;
|
||||
let mut grid = Grid::new(
|
||||
screen_size.rows,
|
||||
screen_size.cols,
|
||||
|
|
@ -74,6 +75,7 @@ fn take_snapshots_and_cursor_coordinates_from_render_events<'a>(
|
|||
Rc::new(RefCell::new(LinkHandler::new())),
|
||||
character_cell_size,
|
||||
sixel_image_store,
|
||||
debug,
|
||||
);
|
||||
let snapshots: Vec<(Option<(usize, usize)>, String)> = all_events
|
||||
.filter_map(|server_instruction| {
|
||||
|
|
@ -232,6 +234,7 @@ fn create_new_screen(size: Size) -> Screen {
|
|||
let session_is_mirrored = true;
|
||||
let copy_options = CopyOptions::default();
|
||||
|
||||
let debug = false;
|
||||
let screen = Screen::new(
|
||||
bus,
|
||||
&client_attributes,
|
||||
|
|
@ -241,6 +244,7 @@ fn create_new_screen(size: Size) -> Screen {
|
|||
auto_layout,
|
||||
session_is_mirrored,
|
||||
copy_options,
|
||||
debug,
|
||||
);
|
||||
screen
|
||||
}
|
||||
|
|
@ -281,6 +285,7 @@ impl MockScreen {
|
|||
Some(Box::new(self.os_input.clone())),
|
||||
)
|
||||
.should_silently_fail();
|
||||
let debug = false;
|
||||
let screen_thread = std::thread::Builder::new()
|
||||
.name("screen_thread".to_string())
|
||||
.spawn(move || {
|
||||
|
|
@ -290,6 +295,7 @@ impl MockScreen {
|
|||
None,
|
||||
client_attributes,
|
||||
Box::new(config_options),
|
||||
debug,
|
||||
)
|
||||
.expect("TEST")
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue