w3m icon indicating copy to clipboard operation
w3m copied to clipboard

fix for ti and te

Open archenemies opened this issue 4 years ago • 1 comments

When I run w3m in Xterm, ti and te are defined, and Xterm is configured to ignore them via

XTerm*titeInhibit: true

Thus I do not need to pass -X to w3m.

However, in Rxvt-Unicode, which I prefer, there is no ti and te. Instead I have smcup/rmcup. The standard escape sequences for these are disabled within the terminal, and I have both set to the empty string in my terminfo file.

But w3m doesn't know about smcup/rmcup. Rather, in terms.c:899 (reset_tty), it falls back to sending a "clear" sequence when te is missing:

if (!Do_not_use_ti_te) {
  if (T_te && *T_te)
      writestr(T_te);
  else
      writestr(T_cl);
}

I think it would be better to delete the else writestr(T_cl); (which is useless since it doesn't actually restore the secondary screen) or fall back to smcup/rmcup in here and also in initscr.

archenemies avatar Apr 24 '20 11:04 archenemies