Topic summary

Bracketed-paste

Bracketed-paste

Feature of some terminal emulators Bracketed paste (sometimes referred to as paste bracketing ) is a mode of some terminal emulators which allows programs running in the terminal to treat pasted text differently from text typed normally. History The bracketed paste feature was introduced by xterm in 2002, as a user-contributed change to improve interaction with Emacs. Later, in 2005, another user documented this as part of another select/paste feature for the JOE editor. Over the course of several years, other developers adapted the feature for terminal emulators and editors which work with this feature. Motivation Bracketed paste is used to resolve the following issue, commonly encountered when editing code in a terminal text editor (such as Vim or Emacs). These text editors often include autoindent functionality, which causes indentation to be added automatically when the user presses the enter key at the end of a line. For example, suppose we are editing the following code block in a text editor, with the cursor position marked by the | character.def f(): print('foo')| If the user presses enter, text editors will often advance the cursor to the location marked in the next code b