Skip to content

Missing support for bracketed paste #404

@knz

Description

@knz

Bracketed paste is an optional feature that modifies how the terminal handles a "paste from clipboard" action by a user.
(e.g. middle mouse click in xterm, ctrl+shift+v in vte, etc)

The feature must first be enabled by sending CSI ? 2004 h to the terminal. After bracketed paste is enabled, each pasted text gets enclosed between CSI 200~ and CSI 201~.

The reason why this feature exist is well explained in the wikipedia page:

image

Likewise, in the Bubbline library, which we intend to use for CockroachDB's SQL shell, we also want to interpret a manually entered newline as a special "run" command, but we also want to give users the option to paste a SQL text containing newline characters without running them.

Prototype implementation

These 3 PRs:

Terminal support

Terminal Bracketed Paste
alacritty
foot
kitty
Konsole
rxvt
screen 1
st
tmux
vte-based
wezterm
xterm
Linux Console
Apple Terminal
iTerm
Windows cmd
Windows Terminal

Footnotes

  1. A patch is available here https://gist.github.com/saitoha/2977889

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions