~rjarry/aerc#52: 
Seems like aerc and its :term understand <F13> differently

If my terminal emulator sends <F13> as ^[[1;2P, then aerc does understand it (e.g., I can map it like <F13> :cf INBOX<Enter> in binds.conf). But in this case :term doesn't get it (cat in :term shows nothing if I press <F13>, and I can't map it in Vim, which I use for writing emails).

However, if my terminal emulator sends ^[[25~ as <F13>, then :term captures it OK (cat shows the correct value, and I can map it Vim, for instance), but aerc itself doesn't respond to it at all.

As a result, with aerc, I can't really use <F13> (and probably <F14>, <F15>, and so on).

Thank you.

Status
REPORTED
Submitter
~john1doe
Assigned to
No-one
Submitted
5 months ago
Updated
14 days ago
Labels
feature ui

~rjarry 4 months ago

Hi,

I don't have an <F13> key on my keyboard to reproduce the issue. However, I assume this is due to discrepancies between your own terminal emulator in which you are running aerc itself, and the terminal emulator of aerc (based on libvterm) which is used to execute $EDITOR, $PAGER and :term.

Do you have the same issue with <F12>?

~poldi1405 4 months ago

F13-F24 are rarely there as physical keys. You can try Shift+F1…Shift+F12

~john1doe 4 months ago

I don't have an <F13> key on my keyboard to reproduce the issue

Well, you can probably instruct your terminal emulator to map the required Escape sequence to any key? Or, as ~poldi1405 said, simply use <Shift-F1>.

The problem is, while we can map <F13> in aerc (and press <Shift-F1> in call this binding, it sure does work for me), it won't work in $EDITOR or :term. So, yes, as you said, some discrepancies between my terminal emulator, and the terminal emulator of aerc. Would be great to fix that somehow :)

(For anyone interested, there's a stupid workaround for this: I set in my terminal emulator <F13> to send some obscure Unicode symbol, which I won't use otherwise. And then map this symbol both in aerc and $EDITOR. This way, my <F13> key indeed works in both environments. But, of course, it's only an ugly crutch.)

Do you have the same issue with <F12>?

No, I don't.

~rjarry 2 months ago

Could you try that again now that libvterm has been replaced by a pure go implementation?

~john1doe 2 months ago

~rjarry

Nothing has changed in this aspect:

  • If my terminal emulator sends ^[[1;2P as <F13>:
    • I can map it in aerc as <F13>, aerc reacts to these mappings
    • aerc's :term doesn't recognize it: I run :term, launch cat there, press <F13>, see ^@
  • If my terminal emulator sends ^[[25~ as <F13>:
    • aerc doesn't react to <F13> mappings
    • aerc's :term recognizes it correctly (cat in :term reports ^[[25~).

~rockorager 2 months ago

What terminal are you using?

I think this will be fixed when the next tcell-term version is applied. It was setting $TERM to xterm-256color, but the xterm tcell term info entry doesn’t have an F13 key. I removed the setting of $TERM so whatever you’re using now should translate through directly with aerc and the terminal since they are both using tcell and the same terminfo.

~john1doe 2 months ago*

What terminal are you using?

Mainly kitty. But it also fails in xterm and alacritty (though haven't tested it thoroughly there).

It was setting $TERM to xterm-256color,

Just to clarify, I was testing this when the bug with imposed $TERM was already fixed (:term was reporting the inherited $TERM, not xterm-256color).

~rockorager 2 months ago

Hmm. None of the terminfo entries for those have an F13 key in tcell.

What if you set $term to rxvt-256color?

~rockorager 2 months ago

I found at least part of the issue. tcell-term doesn't support > F13 as of now. I'll start a bug tracker and add that as a bug.

~john1doe 2 months ago

What if you set $term to rxvt-256color?

Hhm... Seems like setting $TERM to rxvt-256color somehow reverses the situation (tested in alacritty with aerc version 0.12.0-67-g8e53d330614f):

  • If alacritty sends ^[[25~ as <F13>:
    • I can map it in aerc as <F13>, aerc reacts to these mappings
    • aerc's :term doesn't recognize it: I run :term, launch cat there, press <F13>, see ^@
  • If alacritty sends ^[[1;2P as <F13>:
    • aerc doesn't react to <F13> mappings
    • aerc's :term recognizes it correctly (cat in :term reports ^[[1;2P).
Register here or Log in to comment, or comment via email.