Hello, as the title says, aerc has some trouble when using GNU Emacs as
message editor. The problem manifests itself as Enter scrolling the entire
terminal and not just Emacs' content, at least until manual repainting is
done (C-l or SIGWINCH).
My environment is the following:
* aerc: 1.14 on Gentoo
* terminal emulator: st, but reproducible on vanilla xterm too
* editor: emacs -nw -q -Q (i.e. vanilla Emacs 28.3, no init file loaded)
Here is a small video of the phenomenon: http://0x0.st/HHOO.mkv
Does anyone have a clue? I switched to the lighter mg in the meantime.
I'm having a similar issue with emacs. This is how I can reproduce it reliably:
- In an empty mail body, enter 8 ASCII characters. It doesn't matter which
ones. We'll go with "12345678".
- The expected cursor position would be after "8", but it is one character
before that, indicating that typing another character inserts between "7"
and "8".
- If you move the cursor to the right (by pressing <right> or <c-f>), this has
seemingly no effect. Pressing <left> or <c-b> afterwards also seems to have
no effect.
- But everything was actually entered correctly, it's just displayed
wrong. <c-l> or <enter> fixes the line and displays everything as it was
typed.
- This happens independently of the terminal emulator. I tried alacritty,
xterm and urxvt.
And now the weird part: The culprit was the following line in my ~/.emacs.d/init.el:
(setq mode-line-position '("%l:%c"))
Commenting out this line fixed the issue for me. I have no idea why it is
relevant, but my hunch is that Emacs utilizes some advanced escape sequence
magic that aerc hasn't implemented.
Hello, still broken using latest git and editor='emacs -nw -Q -q'. Simply playing
with spaces, tabulation, C-{Left,Right}, Home/C-a, End/C-e and the minibuffer makes
the cursor jumps around randomly.
On Fri, 03 May 2024 08:21:29 CDT, q3cpma@posteo.net wrote:
> Hello, still broken using latest git and editor='emacs -nw -Q -q'. Simply playing> with spaces, tabulation, C-{Left,Right}, Home/C-a, End/C-e and the minibuffer makes> the cursor jumps around randomly.
Can you verify the aerc version you are using? There was a bug regarding tab
stops in the vterm which is fixed on aerc master and sounds like the bug
described.
--
Tim
On Sun May 5, 2024 at 1:55 PM CEST, Tim Culverhouse wrote:
> On Fri, 03 May 2024 08:21:29 CDT, q3cpma@posteo.net wrote:> > Hello, still broken using latest git and editor='emacs -nw -Q -q'. Simply playing> > with spaces, tabulation, C-{Left,Right}, Home/C-a, End/C-e and the minibuffer makes> > the cursor jumps around randomly.>> Can you verify the aerc version you are using? There was a bug regarding tab> stops in the vterm which is fixed on aerc master and sounds like the bug> described.> ./aerc -v
aerc 0.17.0-122-g7b4c8f67eb5f (go1.22.2 amd64 linux 2024-05-03)
Here's a small video of the problem. On the first line, I navigate solely by arrow keys:
http://0x0.st/XXk-.mkv
On Sun, 05 May 2024 07:13:11 CDT, q3cpma@posteo.net wrote:
> aerc 0.17.0-122-g7b4c8f67eb5f (go1.22.2 amd64 linux 2024-05-03)> > Here's a small video of the problem. On the first line, I navigate solely by arrow keys:> http://0x0.st/XXk-.mkv
Thanks for the video, I can reproduce. I'll take a look
Can you pull the latest vaxis in your aerc repo? I am unable to reproduce with
that (there was a change to the timer / dirty handling for the vterm that looks
to be the issue).
`go get git.sr.ht/~rockorager/vaxis@main`
On Sun May 5, 2024 at 1:55 PM CEST, Tim Culverhouse wrote:
> On Fri, 03 May 2024 08:21:29 CDT, q3cpma@posteo.net wrote:> > Hello, still broken using latest git and editor='emacs -nw -Q -q'. Simply playing> > with spaces, tabulation, C-{Left,Right}, Home/C-a, End/C-e and the minibuffer makes> > the cursor jumps around randomly.>> Can you verify the aerc version you are using? There was a bug regarding tab> stops in the vterm which is fixed on aerc master and sounds like the bug> described.
Not sure whether it is the same, but
https://lists.sr.ht/~rjarry/aerc-devel/%3CD0ZG3WLAIOMB.1TLEQKT3UR0OP@cepl.eu%3E
seems pretty much alive and well in 7b4c8f67.
Best,
Matěj
--
http://matej.ceplovi.cz/blog/, @mcepl@floss.social
GPG Finger: 3C76 A027 CA45 AD70 98B5 BC1D 7920 5802 880B C9D8
I didn’t attend the funeral, but I sent a nice letter saying
I approved of it.
-- Mark Twain
On Sun May 5, 2024 at 2:18 PM CEST, Tim Culverhouse wrote:
> Can you pull the latest vaxis in your aerc repo? I am unable to reproduce with> that (there was a change to the timer / dirty handling for the vterm that looks> to be the issue).>> `go get git.sr.ht/~rockorager/vaxis@main`
Thanks, this fixes most of the problems I've seen. Two remainings are:
1. The status bar is invsible except for the filename.
2. Mark (C-Space) is invisible.
3. C-h is passed as a backspace to emacs.
4. The completion list at the bottom. Try to type M-x (Alt-x), then enter
"show-paren-" then Tab, the cursor jumps in the prompt buffer.
5. The highlighting of matching parens sometimes makes the cursor jump around and
corrupts the rendering until redraw (C-l); this problem is much older than the new
term impl, though.
This example line (the length before the opening parens seems important) reproduces
the problem:
xxhello world (foo bar foo bar)
Video showing 4 and 5: http://0x0.st/XXd9.mkv
Thanks for this list! Here's my two cents (on spacemacs with evil mode):
On 05/05/2024, 16:25, q3cpma wrote:
> 1. The status bar is invsible except for the filename.
I can see the spacemacs' status bar without issues.
> 2. Mark (C-Space) is invisible.
If I deactivate evil mode or while in insert-mode, C-Space gives me a weird
string: "�" (In case it doesn't show like this elsewhere, it's three chars:
ï, ¿, and the one-half fraction char.)
However, the introduction of this escape code breaks my text: I see repeated
lines and I need to go up to the top to make it right.
> 3. C-h is passed as a backspace to emacs.
Not in my case: both with evil disabled and enabled, spacemacs reads C-h
properly (launches help).
> 4. The completion list at the bottom. Try to type M-x (Alt-x), then enter "show-paren-" then Tab, the cursor jumps in the prompt buffer.
While this behaviour is familiar to me (especially in the email address
completion through company), I can't reproduce it right now.
> 5. The highlighting of matching parens sometimes makes the cursor jump around and corrupts the rendering until redraw (C-l); this problem is much older than the new term impl, though.
I can definitely confirm this behaviour.
On Sun, 05 May 2024 09:25:38 CDT, q3cpma@posteo.net wrote:
> Thanks, this fixes most of the problems I've seen. Two remainings are:> 1. The status bar is invsible except for the filename.> 2. Mark (C-Space) is invisible.> 3. C-h is passed as a backspace to emacs.
What terminal do you use? Some terminals define C-h as backspace and some define
C-? as backspace. Vaxis tries to normalize this by assuming *either* is
backspace, and then when it re-encodes it to the terminal it will always encode
it as C-?. So, for example, if Vaxis reads a 0x08 (C-h) key, it internally says
this is actually 0x7F (C-?). Then the terminal gets the key as a 0x7F and writes
that to the underlying process. That is likely why your C-h is coming through as
a backspace...it's currently impossible (unless you have kitty keyboard) to send
a C-h to the Vaxis terminal.
On Sun May 5, 2024 at 4:55 PM CEST, Tim Culverhouse wrote:
> On Sun, 05 May 2024 09:25:38 CDT, q3cpma@posteo.net wrote:> > Thanks, this fixes most of the problems I've seen. Two remainings are:> > 1. The status bar is invsible except for the filename.> > 2. Mark (C-Space) is invisible.> > 3. C-h is passed as a backspace to emacs.>> What terminal do you use? Some terminals define C-h as backspace and some define> C-? as backspace. Vaxis tries to normalize this by assuming *either* is> backspace, and then when it re-encodes it to the terminal it will always encode> it as C-?. So, for example, if Vaxis reads a 0x08 (C-h) key, it internally says> this is actually 0x7F (C-?). Then the terminal gets the key as a 0x7F and writes> that to the underlying process. That is likely why your C-h is coming through as> a backspace...it's currently impossible (unless you have kitty keyboard) to send> a C-h to the Vaxis terminal.
I normally use st, but also test with xterm, usually. Did so and both 1 and 2
work on said xterm, don't know how much of this is due to st or something in
vaxis/tcell harcoding xterm stuff in favour of reading terminfo.
C-h is still sent as backspace (even with "Delete is DEL" enabled) and 5 still
happens.
On Sun May 5, 2024 at 4:48 PM CEST, inwit wrote:
> Thanks for this list! Here's my two cents (on spacemacs with evil mode):>> On 05/05/2024, 16:25, q3cpma wrote:> > 1. The status bar is invsible except for the filename.> I can see the spacemacs' status bar without issues.>> > 2. Mark (C-Space) is invisible.> If I deactivate evil mode or while in insert-mode, C-Space gives me a weird> string: "�" (In case it doesn't show like this elsewhere, it's three chars:> ï, ¿, and the one-half fraction char.)>> However, the introduction of this escape code breaks my text: I see repeated> lines and I need to go up to the top to make it right.>> > 3. C-h is passed as a backspace to emacs.> Not in my case: both with evil disabled and enabled, spacemacs reads C-h> properly (launches help).>
I think it's a good idea to only test vanilla 'emacs -nw -q -Q' to avoid setup
specific issues, at least for now.
Which terminal emulator do you use, by the way?
On 05/05/2024, 17:10, wrote:
> I think it's a good idea to only test vanilla 'emacs -nw -q -Q' to avoid setup specific issues, at least for now.
You're right, of course.
> Which terminal emulator do you use, by the way?
Foot.
On Sun, 05 May 2024 10:13:12 CDT, inwit wrote:
> > Which terminal emulator do you use, by the way?> Foot.
Ok this explains it. st/xterm don't have kitty keyboard but foot does, which is
why C-h is working for you.
I will need to think of a nice way to handle this internally to Vaxis - possibly
adding a new field on a key event to distinguish between C-h and C-? in legacy
key encodings...
--
Tim