Re: [PATCH] Add support for ANSI.SYS SCP/RCP escape codes

2015-09-12 Thread Samuel Thibault
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: .  */

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: .  */
> +  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
> 
> 



Re: [PATCH] Add support for ANSI.SYS SCP/RCP escape codes

2015-09-12 Thread James Clarke
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  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: .  */
> 
> 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: .  */
>> +  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
>> 
>> 



Re: [PATCH] Add support for ANSI.SYS SCP/RCP escape codes

2015-09-12 Thread Samuel Thibault
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.

Applied, thanks!

Samuel



Re: [PATCH] Add support for ANSI.SYS SCP/RCP escape codes

2015-09-12 Thread Samuel Thibault
James Clarke, le Sat 12 Sep 2015 10:50:37 +0100, a écrit :
> 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).

Ok.  They should just use terminfo to know which code they should emit,
but well...

> 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).

Ok :)

Samuel



Re: pflocal socket bug

2015-09-12 Thread Samuel Thibault
Svante Signell, le Fri 11 Sep 2015 19:50:21 +0200, a écrit :
> Well, the Linux manpage for connect says:

The linux manpage is not supposed to be relevant.

> While POSIX says:
> http://pubs.opengroup.org/onlinepubs/9699919799/functions/connect.html
> [EADDRNOTAVAIL]
> The specified address is not available from the local machine.
> [ECONNREFUSED]
> The target address was not listening for connections or refused
> the connection request.
> 
> To me the best explanation is "No-one listening on the remote address."

Take care that we may also be in the connection-less case, which does
not have the notion of listening and connection.

> and "The target address was not listening for connections or refused the
> connection request." Additionally it is related to connect() by the
> error name itself.

In the connection-less case, connect is not meant to connect, but just
to specify the default destination address only.

> The Hurd patch is very simple:

If you didn't mangle it by pasting it twice :)

> Why not align to other OSes?

"aligning" is not necessarily the right solution.  But here it should be
fine, yes.  I have fixed both connect() and sendto().

Samuel