Discussion:
[gentoo-user] An annoyance in GPM, and a fix for it
(too old to reply)
Alan Mackenzie
2023-10-04 18:20:01 UTC
Permalink
Hello, Gentoo.

In the GPM mouse utility in a tty, one can use a double click to select
a word (and by holding the button down and moving the mouse, select a
sequence of words).

Similarly, with a triple click, one can select a line, or a sequence of
lines. This is all very fine, but GPM adds a CR after each line in the
sequnce, INCLUDING THE LAST ONE. This makes it less useful for, say,
copying a shell script command from and editor onto a command line.
Because typically, you'd want to edit the command before executing it,
but with GPM's mechanism, the CR on the end immediately executes it, not
giving you a chance to edit it.

A solution to this problem is not to append the CR to the last line in a
sequence of lines selected by GPM. This means patching the kernel. To
apply the patch, first get the attached patch into the kernel's
directory, and do something like:

# patch -p1 < 6.1.8-TRIPLE.20231004.diff

, then rebuild the kernel. Install this kernel into your boot manager,
and voilĂ  - the problem is solved. :-)

The usual disclaimer applies.
--
Alan Mackenzie (Nuremberg, Germany).
Nikos Chantziaras
2023-10-09 09:40:01 UTC
Permalink
Post by Alan Mackenzie
Similarly, with a triple click, one can select a line, or a sequence of
lines. This is all very fine, but GPM adds a CR after each line in the
sequnce, INCLUDING THE LAST ONE. This makes it less useful for, say,
copying a shell script command from and editor onto a command line.
Because typically, you'd want to edit the command before executing it,
Hm. Bash by default will ignore a newline when pasting something. I
think it's relatively new feature (like a year or two.) It's called
"bracketed paste." It should be enabled by default. If not, it can
enabled with:

set enable-bracketed-paste on

Loading...