From 03407cae99a2443a2bc0c73f4e72fa169b78568b Mon Sep 17 00:00:00 2001 From: Thayne McCombs Date: Tue, 30 Jul 2024 00:38:25 -0600 Subject: [PATCH] fix: Use cols not rows for left margin bound The location of the left margin should depend on the width, not the height. Fixes: #5750 --- term/src/terminalstate/mod.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/term/src/terminalstate/mod.rs b/term/src/terminalstate/mod.rs index 02d1690af..ddbd8772a 100644 --- a/term/src/terminalstate/mod.rs +++ b/term/src/terminalstate/mod.rs @@ -2315,9 +2315,8 @@ impl TerminalState { // The terminal only recognizes this control function if vertical split // screen mode (DECLRMM) is set. if self.left_and_right_margin_mode { - let rows = self.screen().physical_rows as u32; let cols = self.screen().physical_cols as u32; - let left = left.as_zero_based().min(rows - 1).max(0) as usize; + let left = left.as_zero_based().min(cols - 1).max(0) as usize; let right = right.as_zero_based().min(cols - 1).max(0) as usize; // The value of the left margin (Pl) must be less than the right margin (Pr).