[terminology] Handling csi escape code 'Z'.

Unfortunately it doesn't fix the 'rendering' problems of the
application it came from yet (mutt-kz), but it seems to be what
http://www.inwap.com/pdp10/ansicode.txt says it should do.

Anyone using mutt with a sidebar (only on sidebar showing mode we get
the booboos, but not on other terminals) willing to help? :P



SVN revision: 77442
This commit is contained in:
Gustavo Lima Chaves 2012-10-04 15:23:07 +00:00
parent 31e6db4883
commit f7e338ebab
1 changed files with 26 additions and 0 deletions

View File

@ -824,6 +824,32 @@ _handle_esc_csi(Termpty *ty, const Eina_Unicode *c, Eina_Unicode *ce)
case 'g': // clear tabulation
break;
*/
case 'Z': // Cursor Back Tab
{
int i, size, cx = ty->state.cx, cy = ty->state.cy;
arg = _csi_arg_get(&b);
if (arg < 1) arg = 1;
size = ty->w * cy + cx + 1;
for (i = size - 1; i >= 0; i--)
{
if (ty->screen[cx + (cy * ty->w)].att.tab) arg--;
cx--;
if (cx < 0)
{
cx = ty->w - 1;
cy--;
}
if (!arg) break;
}
if (!arg)
{
ty->state.cx = cx;
ty->state.cy = cy;
}
}
break;
default:
ERR("unhandled CSI '%c' (0x%02x)", *cc, *cc);
break;