matterhorn-chat / matterhorn

A feature-rich Unix terminal client for the Mattermost chat system
BSD 3-Clause "New" or "Revised" License
1.04k stars 76 forks source link

Keybind A-Up and A-Down does not work #819

Closed phellarv closed 8 months ago

phellarv commented 8 months ago

When I try to add: [keybindings] focus-next-channel = A-Up focus-prev-channel = A-Down

in the config.ini, it does not work. It removes the current binding, but it does not add the binding which I try to add.

jtdaugherty commented 8 months ago

Hi @phellarv. Different terminals send different sequences for certain key and modifier combinations and Matterhorn's terminal input processing might not recognize those sequences. What do you get when you perform these steps?

For example, when I do it, I get this:

$ cat >/dev/null
^[^[[B

Let me know what you get and then I'll see what we can do from there.

phellarv commented 8 months ago

Hi,

Thanks. Here is my results from /dev/null

$ cat >/dev/null
^[[1;3B

I hope that gives you something to work from.

jtdaugherty commented 8 months ago

Okay. Given that, I think the steps described in this FAQ entry ought to be helpful. Can you take a look?

phellarv commented 8 months ago

Hi, I did the steps outlined in the FAQ, and ended up with a ~/.vty/config with a content like this:

map _ "\ESC[1;3B" KDown [MAlt]
map _ "\ESC[1;3A" KUp [MAlt]

But no cigar. Alt-Up and Alt-Down does not work.

I tried to see if there was a possibility that I could get some debug from matterhorn, and ran VTY_DEBUG_LOG=/tmp/matterhorn-keys-debug matterhorn. But that did not produce any logs.

Please advice on how to dig further, or tell me where I went wrong.

phellarv commented 8 months ago

By the way - I tried MMeta instead of MAlt, but still nothing.

phellarv commented 8 months ago

Hi,

I think I brainfarted. But anyways. This combo works now: ~/.vty/config

map _ "\ESC[1;3B" KDown [MMeta]
map _ "\ESC[1;3A" KUp [MMeta]

~/.config/matterhorn/config.ini [keybindings]

focus-next-channel = M-Down
focus-prev-channel = M-Up

Thanks for pointing me in the right direction.

Regards Per-Arne

jtdaugherty commented 8 months ago

I'm glad to hear that you've gotten it working!