Fix legacy --cols and --rows options for winsize overriding

This commit is contained in:
Marcin Kulik
2024-09-20 10:50:47 +02:00
parent c325265faa
commit 6f2dcb434b
2 changed files with 4 additions and 2 deletions

View File

@@ -99,10 +99,10 @@ pub struct Record {
pub tty_size: Option<(Option<u16>, Option<u16>)>,
#[arg(long, hide = true)]
cols: Option<u16>,
pub cols: Option<u16>,
#[arg(long, hide = true)]
rows: Option<u16>,
pub rows: Option<u16>,
}
#[derive(Debug, Args)]

View File

@@ -148,6 +148,8 @@ impl cli::Record {
fn get_tty(&self) -> Result<FixedSizeTty> {
let (cols, rows) = self.tty_size.unwrap_or((None, None));
let cols = cols.or(self.cols);
let rows = rows.or(self.rows);
if self.headless {
Ok(FixedSizeTty::new(tty::NullTty::open()?, cols, rows))