From 891039060218a37d27ea8cb484cddc322caa8ea9 Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Mon, 30 Dec 2024 13:53:46 +0100 Subject: [PATCH] Work around broken macOS CI seemingly missing parm_index in terminfo Commit 83b0294fc9 (ctrl-l to scroll content instead of erasing screen, 2024-12-21) broke tests like tests/checks/tmux-autosuggestion.fish on macOS CI. I didn't get to the bottom of this but it's probably because terminfo is broken on that CI system. A (related?) failure mode can be observed using TERM=linux-m ssh my-mac tmux ctrl-l moves the cursor but fails to scroll the text. The only reason for using terminfo here was to be consistent with the rest of the code base. Let's use a hardcoded value instead; I don't see why any terminal would deviate from xterm here. This fixes macOS CI and the TERM=linux-m "misconfiguration". It is possible that we should be using a different escape sequence here; I'm not sure. --- src/screen.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/screen.rs b/src/screen.rs index a656d96d0..17301e37b 100644 --- a/src/screen.rs +++ b/src/screen.rs @@ -502,9 +502,7 @@ impl Screen { let mut out = zelf.outp.borrow_mut(); let prompt_y = i32::try_from(prompt_y).unwrap(); // Scroll down. - if let Some(scroll) = term.parm_index.as_ref() { - out.tputs_if_some(&tparm1(scroll, prompt_y)); - } + out.tputs_bytes(format!("\x1b[{}S", prompt_y).as_bytes()); // Reposition cursor. if let Some(up) = term.parm_cursor_up.as_ref() { out.tputs_if_some(&tparm1(up, prompt_y));