diff --git a/man/linutil.1 b/man/linutil.1 index d31cf879..a85bee96 100644 --- a/man/linutil.1 +++ b/man/linutil.1 @@ -36,6 +36,10 @@ Defaults to \fIdefault\fR. \fB\-\-override\-validation\fR Show all available entries, disregarding compatibility checks. (\fBUNSAFE\fR) +.TP +\fB\-\-size\-bypass\fR +Bypass the terminal size limit + .TP \fB\-h\fR, \fB\-\-help\fR Print help. diff --git a/tui/src/main.rs b/tui/src/main.rs index 801e3b1d..df20e733 100644 --- a/tui/src/main.rs +++ b/tui/src/main.rs @@ -33,12 +33,15 @@ struct Args { #[arg(long, default_value_t = false)] #[clap(help = "Show all available options, disregarding compatibility checks (UNSAFE)")] override_validation: bool, + #[arg(long, default_value_t = false)] + #[clap(help = "Bypass the terminal size limit")] + size_bypass: bool, } fn main() -> io::Result<()> { let args = Args::parse(); - let mut state = AppState::new(args.theme, args.override_validation); + let mut state = AppState::new(args.theme, args.override_validation, args.size_bypass); stdout().execute(EnterAlternateScreen)?; enable_raw_mode()?; diff --git a/tui/src/state.rs b/tui/src/state.rs index 92160bf7..058dcc20 100644 --- a/tui/src/state.rs +++ b/tui/src/state.rs @@ -62,6 +62,7 @@ pub struct AppState { drawable: bool, #[cfg(feature = "tips")] tip: String, + size_bypass: bool, } pub enum Focus { @@ -86,7 +87,7 @@ enum SelectedItem { } impl AppState { - pub fn new(theme: Theme, override_validation: bool) -> Self { + pub fn new(theme: Theme, override_validation: bool, size_bypass: bool) -> Self { let (temp_dir, tabs) = linutil_core::get_tabs(!override_validation); let root_id = tabs[0].tree.root().id(); @@ -104,6 +105,7 @@ impl AppState { drawable: false, #[cfg(feature = "tips")] tip: get_random_tip(), + size_bypass, }; state.update_items(); @@ -186,7 +188,9 @@ impl AppState { pub fn draw(&mut self, frame: &mut Frame) { let terminal_size = frame.area(); - if terminal_size.width < MIN_WIDTH || terminal_size.height < MIN_HEIGHT { + if !self.size_bypass + && (terminal_size.height < MIN_HEIGHT || terminal_size.width < MIN_WIDTH) + { let warning = Paragraph::new(format!( "Terminal size too small:\nWidth = {} Height = {}\n\nMinimum size:\nWidth = {} Height = {}", terminal_size.width,