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.
This commit is contained in:
Johannes Altmanninger 2024-12-30 13:53:46 +01:00
parent b6c2a4c5db
commit 8910390602

View file

@ -502,9 +502,7 @@ impl Screen {
let mut out = zelf.outp.borrow_mut(); let mut out = zelf.outp.borrow_mut();
let prompt_y = i32::try_from(prompt_y).unwrap(); let prompt_y = i32::try_from(prompt_y).unwrap();
// Scroll down. // Scroll down.
if let Some(scroll) = term.parm_index.as_ref() { out.tputs_bytes(format!("\x1b[{}S", prompt_y).as_bytes());
out.tputs_if_some(&tparm1(scroll, prompt_y));
}
// Reposition cursor. // Reposition cursor.
if let Some(up) = term.parm_cursor_up.as_ref() { if let Some(up) = term.parm_cursor_up.as_ref() {
out.tputs_if_some(&tparm1(up, prompt_y)); out.tputs_if_some(&tparm1(up, prompt_y));