2022-01-14 06:49:03

by nick black

[permalink] [raw]
Subject: [patch] console_codes.4: ffix

Fix up the busted OSC command list (reset palette and
set palette). Remove CSI prefix from the list of non-CSI
escapes. End all items of said list with periods,
matching other sections of the page.

Signed-off-by: nick black <[email protected]>
---
man4/console_codes.4 | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)

diff --git man4/console_codes.4 man4/console_codes.4
index d549b76a9..001de1955 100644
--- man4/console_codes.4
+++ man4/console_codes.4
@@ -139,29 +139,28 @@ T}
ESC 8 DECRC T{
Restore state most recently saved by ESC 7.
T}
-ESC [ CSI Control sequence introducer
ESC % Start sequence selecting character set
ESC % @ \0\0\0Select default (ISO 646 / ISO 8859-1)
ESC % G \0\0\0Select UTF-8
ESC % 8 \0\0\0Select UTF-8 (obsolete)
ESC # 8 DECALN T{
-DEC screen alignment test \- fill screen with E's
+DEC screen alignment test \- fill screen with E's.
T}
ESC ( T{
Start sequence defining G0 character set
(followed by one of B, 0, U, K, as below)
T}
ESC ( B T{
-Select default (ISO 8859-1 mapping)
+Select default (ISO 8859-1 mapping).
T}
ESC ( 0 T{
-Select VT100 graphics mapping
+Select VT100 graphics mapping.
T}
ESC ( U T{
-Select null mapping \- straight to character ROM
+Select null mapping \- straight to character ROM.
T}
ESC ( K T{
-Select user mapping \- the map that is loaded by the utility \fBmapscrn\fP(8)
+Select user mapping \- the map that is loaded by the utility \fBmapscrn\fP(8).
T}
ESC ) T{
Start sequence defining G1 (followed by one of B, 0, U, K, as above).
@@ -169,12 +168,13 @@ T}
ESC > DECPNM Set numeric keypad mode
ESC = DECPAM Set application keypad mode
ESC ] OSC T{
-(Should be: Operating system command)
-ESC ] P \fInrrggbb\fP: set palette, with parameter
-given in 7 hexadecimal digits after the final P :-(.
-Here \fIn\fP is the color (0\(en15), and \fIrrggbb\fP indicates
+Operating System Command prefix.
+T}
+ESC ] R Reset palette.
+ESC ] P T{
+Set palette, with parameter given in 7 hexadecimal digits \fInrrggbb\fP after
+the final P. Here \fIn\fP is the color (0\(en15), and \fIrrggbb\fP indicates
the red/green/blue values (0\(en255).
-ESC ] R: reset palette
T}
.TE
.ad
--
2.34.1


--
nick black -=- https://www.nick-black.com
to make an apple pie from scratch,
you need first invent a universe.


2022-01-18 02:54:06

by Alejandro Colomar

[permalink] [raw]
Subject: Re: [patch] console_codes.4: ffix

Hello nick,

On 1/14/22 07:48, nick black wrote:
> Fix up the busted OSC command list (reset palette and
> set palette). Remove CSI prefix from the list of non-CSI
> escapes. End all items of said list with periods,
> matching other sections of the page.
>
> Signed-off-by: nick black <[email protected]>
> ---
> man4/console_codes.4 | 22 +++++++++++-----------
> 1 file changed, 11 insertions(+), 11 deletions(-)
>
> diff --git man4/console_codes.4 man4/console_codes.4
> index d549b76a9..001de1955 100644
> --- man4/console_codes.4
> +++ man4/console_codes.4
> @@ -139,29 +139,28 @@ T}
> ESC 8 DECRC T{
> Restore state most recently saved by ESC 7.
> T}
> -ESC [ CSI Control sequence introducer

As I understand it, it's there because CSI is not a CSI-prefixed
sequence (i.e., you have to first document CSI itself, and then in a
different list you can document sequences prefixed by CSI).
So I'd say it belongs there.

> ESC % Start sequence selecting character set
> ESC % @ \0\0\0Select default (ISO 646 / ISO 8859-1)
> ESC % G \0\0\0Select UTF-8
> ESC % 8 \0\0\0Select UTF-8 (obsolete)
> ESC # 8 DECALN T{
> -DEC screen alignment test \- fill screen with E's
> +DEC screen alignment test \- fill screen with E's.
> T}
> ESC ( T{
> Start sequence defining G0 character set
> (followed by one of B, 0, U, K, as below)
> T}
> ESC ( B T{
> -Select default (ISO 8859-1 mapping)
> +Select default (ISO 8859-1 mapping).
> T}
> ESC ( 0 T{
> -Select VT100 graphics mapping
> +Select VT100 graphics mapping.
> T}
> ESC ( U T{
> -Select null mapping \- straight to character ROM
> +Select null mapping \- straight to character ROM.
> T}
> ESC ( K T{
> -Select user mapping \- the map that is loaded by the utility \fBmapscrn\fP(8)
> +Select user mapping \- the map that is loaded by the utility \fBmapscrn\fP(8).
> T}
> ESC ) T{
> Start sequence defining G1 (followed by one of B, 0, U, K, as above).
> @@ -169,12 +168,13 @@ T}
> ESC > DECPNM Set numeric keypad mode
> ESC = DECPAM Set application keypad mode
> ESC ] OSC T{
> -(Should be: Operating system command)
> -ESC ] P \fInrrggbb\fP: set palette, with parameter
> -given in 7 hexadecimal digits after the final P :-(.
> -Here \fIn\fP is the color (0\(en15), and \fIrrggbb\fP indicates
> +Operating System Command prefix.
> +T}
> +ESC ] R Reset palette.
> +ESC ] P T{
> +Set palette, with parameter given in 7 hexadecimal digits \fInrrggbb\fP after
> +the final P. Here \fIn\fP is the color (0\(en15), and \fIrrggbb\fP indicates
> the red/green/blue values (0\(en255).
> -ESC ] R: reset palette

Regarding this, I don't know what the intention of the original author was.

The pre-git code was (man-pages-1.70):

```
ESC ( U \0\0\0Select null mapping \- straight to character ROM
ESC ( K \0\0\0Select user mapping \- the map that is loaded by
\0\0\0the utility \fBmapscrn\fP(8).
ESC ) Start sequence defining G1
(followed by one of B, 0, U, K, as above).
ESC > DECPNM Set numeric keypad mode
ESC = DECPAM Set application keypad mode
ESC ] OSC (Should be: Operating system command)
ESC ] P \fInrrggbb\fP: set palette, with parameter
given in 7 hexadecimal digits after the final P :-(.
Here \fIn\fP is the color (0-15), and \fIrrggbb\fP indicates
the red/green/blue values (0-255).
ESC ] R: reset palette
.TE
.SS "ECMA-48 CSI sequences"
```

Maybe it should go into a separate subsection called "Operating system
commands"?


Thanks,

Alex


--
Alejandro Colomar
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
http://www.alejandro-colomar.es/

2022-01-21 19:51:28

by nick black

[permalink] [raw]
Subject: Re: [patch] console_codes.4: ffix

Alejandro Colomar (man-pages) left as an exercise for the reader:
> As I understand it, it's there because CSI is not a CSI-prefixed sequence
> (i.e., you have to first document CSI itself, and then in a different list
> you can document sequences prefixed by CSI).
> So I'd say it belongs there.

except this is literally in the table named "ESC- but not
CSI-sequences". and it's not, by itself, a sequence. and it's
detailed in the "ECMA-48 CSI Sequences" section below.

so it is documented, near where it's relevant. IMHO.

if we're going to keep it, we ought add OSC to this section by
the same reasoning. i can do that and send a fresh patch, or you
can do it to my patch, or we can do with what i have.

> Maybe it should go into a separate subsection called "Operating system
> commands"?

well, there are only these few, and they are "ESC- but not CSI
sequences". i don't honestly think the average reader cares
whether something is a CSI or an OSC or linux-specific control
sequence, especially since there's really no user-relevant
reason as to why one is in any given group. but i can go ahead
and break this section out if you'd like.

put another way, some people might read the man page wanting to
know "how do i change a color". i can't imagine anyone ever
wanting to know "what are the various OSC-prefixed commands?"
that said, i'm happy to introduce the substructure if it gets
the formatting fixed =].

--
nick black -=- https://www.nick-black.com
to make an apple pie from scratch,
you need first invent a universe.

2022-01-26 03:07:33

by nick black

[permalink] [raw]
Subject: Re: [patch] console_codes.4: ffix

nick black left as an exercise for the reader:
> if we're going to keep it, we ought add OSC to this section by
> the same reasoning. i can do that and send a fresh patch, or you
> can do it to my patch, or we can do with what i have.
...
> sequence, especially since there's really no user-relevant
> reason as to why one is in any given group. but i can go ahead
> and break this section out if you'd like.
...
> put another way, some people might read the man page wanting to
> know "how do i change a color". i can't imagine anyone ever
> wanting to know "what are the various OSC-prefixed commands?"
> that said, i'm happy to introduce the substructure if it gets
> the formatting fixed =].

Alejandro, would you like me to make some/all of the mentioned
changes, or is this patch fine as it is, or will you be making
the changes? Right now the console_codes(4) page has nasty
formatting errors (addressed herein); even if we make no content
changes, they should be fixed IMHO.

--
nick black -=- https://www.nick-black.com
to make an apple pie from scratch,
you need first invent a universe.