From 904b37e67395975f609590250927430b65f7c9a2 Mon Sep 17 00:00:00 2001 From: Ali Gholami Rudi Date: Thu, 9 Jul 2009 12:28:16 +0430 Subject: [PATCH] fbpterm: add \eM escape --- fbpterm.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/fbpterm.c b/fbpterm.c index 2ef1383..c7d5547 100644 --- a/fbpterm.c +++ b/fbpterm.c @@ -159,13 +159,29 @@ static void escape_bracket(void) } } +static void reverse_index() +{ + pad_scroll(0, pad_rows() - 1, 1); +} + +static int escape_alone(int c) +{ + switch (c) { + case 'M': + reverse_index(); + return 0; + default: + printf("unknown escape char <%c>\n", c); + } + return 1; +} + static void escape(void) { int c = readpty(); if (c == '[') { escape_bracket(); - } else { - printf("unknown escape char <%c>\n", c); + } else if (escape_alone(c)) { writepty(ESC); writepty(c); return; -- 2.11.4.GIT