mod pane_resizer;
mod tiled_pane_grid;
use zellij_tile::prelude::Style;
use zellij_utils::zellij_tile;
use crate::tab::{Pane, MIN_TERMINAL_HEIGHT, MIN_TERMINAL_WIDTH};
use tiled_pane_grid::{split, TiledPaneGrid};
use crate::{
os_input_output::ServerOsApi, output::Output, panes::PaneId, ui::boundaries::Boundaries,
ui::pane_contents_and_ui::PaneContentsAndUi, ClientId,
};
use std::cell::RefCell;
use std::collections::{BTreeMap, HashMap, HashSet};
use std::rc::Rc;
use std::time::Instant;
use zellij_tile::data::ModeInfo;
use zellij_utils::{
input::layout::Direction,
pane_size::{Offset, PaneGeom, Size, SizeInPixels, Viewport},
};
macro_rules! resize_pty {
($pane:expr, $os_input:expr) => {
if let PaneId::Terminal(ref pid) = $pane.pid() {
// FIXME: This `set_terminal_size_using_fd` call would be best in
// `TerminalPane::reflow_lines`
$os_input.set_terminal_size_using_fd(
*pid,
$pane.get_content_columns() as u16,
$pane.get_content_rows() as u16,
);
}
};
}
fn pane_content_offset(position_and_size: &PaneGeom, viewport: &Viewport) -> (usize, usize) {
// (columns_offset, rows_offset)
// if the pane is not on the bottom or right edge on the screen, we need to reserve one space
// from its content to leave room for the boundary between it and the next pane (if it doesn't
// draw its own frame)
let columns_offset = if position_and_size