On 2025-05-11 09:01:04 +0200, fom...@0w.se wrote:
> On Sat, May 10, 2025 at 03:49:20PM +0100, Andrew Mass wrote:
> > One advantage of this is
> > preventing commands from running automatically when pasted into the
> > terminal. This seems beneficial from a security standpoint
> 
> Pasting into a shell is always a sensitive operation and needs caution.
> Even though extra safety nets are useful, this one comes with a high
> cost even besides the needed additional key presses.

Note that one may also paste random data by mistake.
So, safety features are useful in any case.

> FWIIW I consider using this feature in a typical *nix application,
> at least when used as a default, a bad design, because it is stateful
> and assumes that the application has full control over and is the only
> one going to interact with the terminal.

which is the case. It is the application that asks for bracketed paste
mode and deals with it. If you have 2 applications interacting with
the terminal at the same time (without coordination), bad things will
happen anyway.

> These assumptions do not generally hold. In certain quite reasonable
> workflows and scenarios (e.g. when you lose a remote connection) the
> "bracketed paste" becomes a quite annoying nuisance. At least some
> of my colleagues feel so as well.

By "when you lose a remote connection", I suppose that you did a ssh
(in general from an interactive shell). In such a case, it is up to
the application that started ssh to restore the terminal state. This
is needed even when bracketed paste is not supported, as the current
(foreground and background) colors, character set, and other things
set up by curses applications may have been changed on the remote
side. In particular, the alternative character set is very annoying
when it isn't reset, because one cannot see what is written and what
one types.

This is also needed without a remote connection. For instance,
a curses application may crash, thus leaving the terminal in a
bad state.

-- 
Vincent Lefèvre <vinc...@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Pascaline project (LIP, ENS-Lyon)

Reply via email to