mawww / kakoune

mawww's experiment for a better code editor
http://kakoune.org
The Unlicense
9.98k stars 715 forks source link

urxvt terminal emulator message `committed change n` #4499

Open nonumeros opened 2 years ago

nonumeros commented 2 years ago

Question

open urxvt invoke kakoune

type i followed by ctrl-shift-u

message committed change #2

type o followed by ctrl-shift-u

message committed change n

and it goes on and on.

urxvt Xresources settings are minimal:

URxvt.reverseVideo: true URxvt.font: xft:Inconsolata:size=9:antialias=true

*URxvt.geometry: 82x50

Screwtapello commented 2 years ago

What did you expect to happen?

Traditionally terminals can't distinguish Ctrl-Shift-character and Ctrl-character keystrokes, so Ctrl-Shift-U would be the same as Ctrl-U (or <c-u> in Kakoune's syntax).

:doc keys says that <c-u> (in insert mode) is supposed to "commit changes up to now as a single undo group", which seems to match what you're describing.

nonumeros commented 2 years ago

What did you expect to happen?

LOL .

Traditionally terminals can't distinguish Ctrl-Shift-character and Ctrl-character keystrokes, so Ctrl-Shift-U would be the same as Ctrl-U (or <c-u> in Kakoune's syntax).

:doc keys says that <c-u> (in insert mode) is supposed to "commit changes up to now as a single undo group", which seems to match what you're describing.

I need to read the doc. Sorry about that. And I know ctrl-shift-u serves no purpose on either xterm or urxvt, But now, according, to what you're telling me, it turns out that both c-u and ctrl-shift-u behave identically one another.

Do you deeply believe that is acceptable?

In other words, the combination of ctrl-u seems to have the same effect as ctrl-shift-u because of a syntax not imposed by kakoune, but ky the terminals . I mean, why stop there. At that rate, there's no need for further reductionism.

One is constrained by terminals and not by the editor. Correct?

Screwtapello commented 2 years ago

In the traditional terminal input encoding, Ctrl-U and Ctrl-Shift-U send the same bytes to Kakoune, and there's nothing Kakoune can do about it.

Some terminals support a newer input encoding that can distinguish Ctrl-U and Ctrl-Shift-U, and Kakoune will use it if it's available, but it can cause problems too (see #4481 for a recent example). Also, some terminals bind Ctrl-Shift-U to a mode for entering Unicode characters, so it's still unavailable for use in Kakoune.

nonumeros commented 2 years ago

mm… as soon as I saw that infamous ESC[blah blah blah it reminded me, perhaps unrelated of suckless terminal dealing with a erresc: unknown csi ESC[22;0;0t erresc: unknown csi ESC[>4;2m of sorts

no wonder you don't have to deal with any of it under vim -y