[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Add support for ANSI.SYS SCP/RCP escape codes
From: |
James Clarke |
Subject: |
Re: [PATCH] Add support for ANSI.SYS SCP/RCP escape codes |
Date: |
Sat, 12 Sep 2015 10:50:37 +0100 |
Currently the new "apt" command-line tool relies on them (when it installs
packages, it keeps a progress bar at the bottom, but shows a log above),
although they've recently patched it to use the more widely-available ESC 7/8
(though the patch is not yet in sid).
I chose SCP/RCP, because ANSI.SYS called them Save/Restore Cursor Position, and
everywhere seems to refer to them by that acronym (they're even listed on
Wikipedia in the table of codes, despite not being in ECMA-48, nor being
implemented by the VT100).
James
> On 12 Sep 2015, at 10:15, Samuel Thibault <samuel.thibault@gnu.org> wrote:
>
> Hello,
>
> James Clarke, le Sat 12 Sep 2015 00:42:05 +0100, a écrit :
>> This adds support for CSI s and u, which are equivalent to ESC 7 and 8,
>> saving/restoring the cursor position.
>
> Just curious: in which case did you see it a problem, or is it just for
> completeness? (which can always become convenient anyway)
>
>> + case 's': /* ANSI.SYS: Save cursor and attributes. */
>> + /* Save cursor position: <scp>. */
>
> Why scp? AIUI from terminfo(5), scp is the capname for set_color_pair,
> the tcap code for save cursor position is sc.
>
>> + display->cursor.saved_x = user->cursor.col;
>> + display->cursor.saved_y = user->cursor.row;
>> + break;
>> + case 'u': /* ANSI.SYS: Restore cursor and attributes. */
>> + /* Restore cursor position: <rcp>. */
>> + user->cursor.col = display->cursor.saved_x;
>> + user->cursor.row = display->cursor.saved_y;
>> + /* In case the screen was larger before: */
>> + limit_cursor (display);
>> + break;
>> case 'l':
>> /* Reset mode. */
>> for (i = 0; i < parse->nparams; i++)
>> --
>> 2.5.1
>>
>>