vt: bracketed paste support
authorNicolas Pitre <npitre@baylibre.com>
Tue, 20 May 2025 17:16:43 +0000 (13:16 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 21 May 2025 11:41:03 +0000 (13:41 +0200)
commit80fa7a03378588582eb40f89b6f418c0c256cf24
treebdb0f5783dea93121d7914b3fe320af88a30abe0
parentc4c7ead7b86c1e7f11c64915b7e5bb6d2e242691
vt: bracketed paste support

This is comprised of 3 aspects:

- Take note of when applications advertise bracketed paste support via
  "\e[?2004h" and "\e[?2004l".

- Insert bracketed paste markers ("\e[200~" and "\e[201~") around pasted
  content in paste_selection() when bracketed paste is active.

- Add TIOCL_GETBRACKETEDPASTE to return bracketed paste status so user
  space daemons implementing cut-and-paste functionality (e.g. gpm,
  BRLTTY) may know when to insert bracketed paste markers.

Link: https://en.wikipedia.org/wiki/Bracketed-paste
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Reviewed-by: Jiri Slaby <jirislaby@kernel.org>
Link: https://lore.kernel.org/r/20250520171851.1219676-2-nico@fluxnic.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/vt/selection.c
drivers/tty/vt/vt.c
include/linux/console_struct.h
include/uapi/linux/tiocl.h