* [PATCH v4 0/2] TIOCLINUX.2const: Document TIOCL_SETSEL selection modes
@ 2025-03-30 14:30 Günther Noack
2025-03-30 14:30 ` [PATCH v4 1/2] TIOCLINUX.2const: Restructure documentation for " Günther Noack
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Günther Noack @ 2025-03-30 14:30 UTC (permalink / raw)
To: Alejandro Colomar
Cc: Jared Finder, G . Branden Robinson, linux-man, Günther Noack
Hi!
TIOCLINUX's TIOCL_SETSEL sub-code has another layer of sub-operations,
called "selection modes" (even though not all of them actually deal
with the mouse selection).
Going forward, the CAP_SYS_ADMIN requirement will be different for
some of these selection modes, which prompted me to at least list the
different selection modes with a short description. I am leaving
CAP_SYS_ADMIN documentation as it is for now and will send another
patch once these semantics are finalized [1] [2].
Thanks,
–Günther
[1] <https://lore.kernel.org/all/20250221.0a947528d8f3@gnoack.org/>
[2] <https://lore.kernel.org/all/20250223205449.7432-2-gnoack3000@gmail.com/>
History:
V2:
* Split into a "restructuring" and a "new documentation" commit
* Use non-breaking space \~
* Put URIs in <>
* Added a helpful link to console_codes(4) regarding mouse reporting
V3:
* Corrections and clarifications for various selection modes
as suggested by Jared Finder. (Thanks!)
V4:
* Clarified how TIOCL_SELPOINTER selects the coordinate to use
Günther Noack (2):
TIOCLINUX.2const: Restructure documentation for TIOCL_SETSEL selection
modes
TIOCLINUX.2const: Document missing TIOCL_SETSEL selection modes
man/man2const/TIOCLINUX.2const | 59 +++++++++++++++++++++++++++++++---
1 file changed, 54 insertions(+), 5 deletions(-)
Range-diff against v3:
1: d07edb528 = 1: 828c5189a TIOCLINUX.2const: Restructure documentation for TIOCL_SETSEL selection modes
2: 59f217fb0 ! 2: bffc3e550 TIOCLINUX.2const: Document missing TIOCL_SETSEL selection modes
@@ man/man2const/TIOCLINUX.2const: Select line-by-line,
+.RI ( xs ,\~ ys )
+or
+.RI ( xe ,\~ ye ),
-+whichever is greater.
++whichever is later in text flow order.
+.TP
+.B TIOCL_SELCLEAR
+Remove the current selection highlight, if any,
--
2.49.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v4 1/2] TIOCLINUX.2const: Restructure documentation for TIOCL_SETSEL selection modes
2025-03-30 14:30 [PATCH v4 0/2] TIOCLINUX.2const: Document TIOCL_SETSEL selection modes Günther Noack
@ 2025-03-30 14:30 ` Günther Noack
2025-03-30 14:30 ` [PATCH v4 2/2] TIOCLINUX.2const: Document missing " Günther Noack
2025-03-31 8:15 ` [PATCH v4 0/2] TIOCLINUX.2const: Document " Alejandro Colomar
2 siblings, 0 replies; 4+ messages in thread
From: Günther Noack @ 2025-03-30 14:30 UTC (permalink / raw)
To: Alejandro Colomar
Cc: Jared Finder, G . Branden Robinson, linux-man, Günther Noack
* Indent the documented selection modes into tagged paragraphs.
* Document constants from the header file (tiocl.h) instead of numbers.
* Clarify expansion semantics as suggested by Jared Finder.
Signed-off-by: Günther Noack <gnoack3000@gmail.com>
---
man/man2const/TIOCLINUX.2const | 25 ++++++++++++++++++++-----
1 file changed, 20 insertions(+), 5 deletions(-)
diff --git a/man/man2const/TIOCLINUX.2const b/man/man2const/TIOCLINUX.2const
index c0acdd0ea..f2c8d0720 100644
--- a/man/man2const/TIOCLINUX.2const
+++ b/man/man2const/TIOCLINUX.2const
@@ -65,11 +65,26 @@ are the ending
column and row.
(Upper left corner is row=column=1.)
.I sel_mode
-is 0 for character-by-character selection,
-1 for word-by-word selection,
-or 2 for line-by-line selection.
-The indicated screen characters are highlighted and saved
-in a kernel buffer.
+may be one of the following operations:
+.RS
+.TP
+.B TIOCL_SELCHAR
+Select character-by-character.
+The indicated screen characters are highlighted
+and saved in a kernel buffer.
+.TP
+.B TIOCL_SELWORD
+Select word-by-word,
+expanding the selection outwards to align with word boundaries.
+The indicated screen characters are highlighted
+and saved in a kernel buffer.
+.TP
+.B TIOCL_SELLINE
+Select line-by-line,
+expanding the selection outwards to select full lines.
+The indicated screen characters are highlighted
+and saved in a kernel buffer.
+.RE
.IP
Since Linux 6.7, using this subcode requires the
.B CAP_SYS_ADMIN
--
2.49.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH v4 2/2] TIOCLINUX.2const: Document missing TIOCL_SETSEL selection modes
2025-03-30 14:30 [PATCH v4 0/2] TIOCLINUX.2const: Document TIOCL_SETSEL selection modes Günther Noack
2025-03-30 14:30 ` [PATCH v4 1/2] TIOCLINUX.2const: Restructure documentation for " Günther Noack
@ 2025-03-30 14:30 ` Günther Noack
2025-03-31 8:15 ` [PATCH v4 0/2] TIOCLINUX.2const: Document " Alejandro Colomar
2 siblings, 0 replies; 4+ messages in thread
From: Günther Noack @ 2025-03-30 14:30 UTC (permalink / raw)
To: Alejandro Colomar
Cc: Jared Finder, G . Branden Robinson, linux-man, Günther Noack,
Hanno Böck, Jann Horn, Jiri Slaby, jwilk
Documents the following TIOCL_SETSEL sub-operations:
* TIOCL_SELPOINTER
* TIOCL_SELCLEAR
* TIOCL_SELMOUSEREPORT
These previously undocumented selection modes for the Linux console
are implemented in drivers/tty/vt/selection.c. The name "selection
mode" is slightly misleading as not all of them actually manipulate
the kernel's mouse selection buffer.
Includes clarified semantics pointed out by Jared Finder.
Cc: Jared Finder <jared@finder.org>
Cc: Hanno Böck <hanno@hboeck.de>
Cc: Jann Horn <jannh@google.com>
Cc: Jiri Slaby <jirislaby@kernel.org>
Cc: jwilk@jwilk.net
Signed-off-by: Günther Noack <gnoack3000@gmail.com>
---
man/man2const/TIOCLINUX.2const | 34 ++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)
diff --git a/man/man2const/TIOCLINUX.2const b/man/man2const/TIOCLINUX.2const
index f2c8d0720..61f1c596d 100644
--- a/man/man2const/TIOCLINUX.2const
+++ b/man/man2const/TIOCLINUX.2const
@@ -84,6 +84,40 @@ Select line-by-line,
expanding the selection outwards to select full lines.
The indicated screen characters are highlighted
and saved in a kernel buffer.
+.TP
+.B TIOCL_SELPOINTER
+Show the pointer at position
+.RI ( xs ,\~ ys )
+or
+.RI ( xe ,\~ ye ),
+whichever is later in text flow order.
+.TP
+.B TIOCL_SELCLEAR
+Remove the current selection highlight, if any,
+from the console holding the selection.
+.IP
+This does not affect the stored selected text.
+.TP
+.B TIOCL_SELMOUSEREPORT
+Make the terminal report
+.RI ( xs ,\~ ys )
+as the current mouse location
+using the
+.BR xterm (1)
+mouse tracking protocol
+(see
+.BR console_codes (4)).
+The lower 4 bits of
+.I sel_mode
+.RB ( TIOCL_SELBUTTONMASK )
+indicate the desired button press and
+modifier key information for the mouse event.
+.\" <https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Normal-tracking-mode>
+.IP
+If mouse reporting is not enabled for the terminal,
+this operation yields an
+.B EINVAL
+error.
.RE
.IP
Since Linux 6.7, using this subcode requires the
--
2.49.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v4 0/2] TIOCLINUX.2const: Document TIOCL_SETSEL selection modes
2025-03-30 14:30 [PATCH v4 0/2] TIOCLINUX.2const: Document TIOCL_SETSEL selection modes Günther Noack
2025-03-30 14:30 ` [PATCH v4 1/2] TIOCLINUX.2const: Restructure documentation for " Günther Noack
2025-03-30 14:30 ` [PATCH v4 2/2] TIOCLINUX.2const: Document missing " Günther Noack
@ 2025-03-31 8:15 ` Alejandro Colomar
2 siblings, 0 replies; 4+ messages in thread
From: Alejandro Colomar @ 2025-03-31 8:15 UTC (permalink / raw)
To: Günther Noack; +Cc: Jared Finder, G . Branden Robinson, linux-man
[-- Attachment #1: Type: text/plain, Size: 2351 bytes --]
Hi Günther, Jared,
On Sun, Mar 30, 2025 at 04:30:37PM +0200, Günther Noack wrote:
> Hi!
>
> TIOCLINUX's TIOCL_SETSEL sub-code has another layer of sub-operations,
> called "selection modes" (even though not all of them actually deal
> with the mouse selection).
>
> Going forward, the CAP_SYS_ADMIN requirement will be different for
> some of these selection modes, which prompted me to at least list the
> different selection modes with a short description. I am leaving
> CAP_SYS_ADMIN documentation as it is for now and will send another
> patch once these semantics are finalized [1] [2].
>
> Thanks,
> –Günther
>
> [1] <https://lore.kernel.org/all/20250221.0a947528d8f3@gnoack.org/>
> [2] <https://lore.kernel.org/all/20250223205449.7432-2-gnoack3000@gmail.com/>
Thanks! I've applied both patches. I've added Acked-by tags for Jared,
since there was a mail saying LGTM in the previos version, and it hasn't
changed significantly.
Have a lovely day!
Alex
>
> History:
>
> V2:
> * Split into a "restructuring" and a "new documentation" commit
> * Use non-breaking space \~
> * Put URIs in <>
> * Added a helpful link to console_codes(4) regarding mouse reporting
>
> V3:
> * Corrections and clarifications for various selection modes
> as suggested by Jared Finder. (Thanks!)
>
> V4:
> * Clarified how TIOCL_SELPOINTER selects the coordinate to use
>
> Günther Noack (2):
> TIOCLINUX.2const: Restructure documentation for TIOCL_SETSEL selection
> modes
> TIOCLINUX.2const: Document missing TIOCL_SETSEL selection modes
>
> man/man2const/TIOCLINUX.2const | 59 +++++++++++++++++++++++++++++++---
> 1 file changed, 54 insertions(+), 5 deletions(-)
>
> Range-diff against v3:
> 1: d07edb528 = 1: 828c5189a TIOCLINUX.2const: Restructure documentation for TIOCL_SETSEL selection modes
> 2: 59f217fb0 ! 2: bffc3e550 TIOCLINUX.2const: Document missing TIOCL_SETSEL selection modes
> @@ man/man2const/TIOCLINUX.2const: Select line-by-line,
> +.RI ( xs ,\~ ys )
> +or
> +.RI ( xe ,\~ ye ),
> -+whichever is greater.
> ++whichever is later in text flow order.
> +.TP
> +.B TIOCL_SELCLEAR
> +Remove the current selection highlight, if any,
> --
> 2.49.0
>
--
<https://www.alejandro-colomar.es/>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-03-31 8:15 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-30 14:30 [PATCH v4 0/2] TIOCLINUX.2const: Document TIOCL_SETSEL selection modes Günther Noack
2025-03-30 14:30 ` [PATCH v4 1/2] TIOCLINUX.2const: Restructure documentation for " Günther Noack
2025-03-30 14:30 ` [PATCH v4 2/2] TIOCLINUX.2const: Document missing " Günther Noack
2025-03-31 8:15 ` [PATCH v4 0/2] TIOCLINUX.2const: Document " Alejandro Colomar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox