Closed AckslD closed 3 years ago
Do you mean: while the focus is in the conversation pane, to change the current (opened) conversation with J
/K
, without having to press Tab
to move to the contacts pane? Or make those keys do what g
/G
do (go to the top / bottom)?
The first one, i.e. without having to press Tab
. I'm using aerc for mail where J
/K
goes to next/previous folder and I keep noticing that I try to do the same when I'm using scli.
Yes, this can be added. While the focus is on the chat messages, pressing J
/K
will change the opened chat and keep the focus in the (new) messages list.
I was just wondering now actually if different keys would be better such as ctrl+j
/ctrl+k
or ctrl+n
/ctrl+p
since they could perhaps then also be used if focus is in the input-field.
That's a good point.
The Ctrl+n
/p
combos would be claimed in the upcoming version for moving up and down the messages list when chat is in focus, and for cycling through commands history when the input line is in focus. (WIP)
The Ctrl+j
/k
should be a good alternative. It's not currently used for anything, and cycling through contacts' chats seems like the most natural assignment for it.
Maybe also J
/K
can be added for good measure, but will have effect only when the messages list is in focus, as above.
EDIT: oops, turns out Ctrl+j
is interpreted by terminal emulators as Enter
. This is the same limitation in terminals as in https://github.com/isamert/scli/issues/92#issuecomment-729665237, nothing we can do here. So will need to pick a different key combo. Maybe Alt+j
/k
? Another option: Alt+Up
/Down
, this is what signal-desktop uses.
Alt+j/k sounds good to me 👍 Although the optimal would be if that could be configured by the user :)
Regarding the issue with ctrl+j btw, is that only in certain terminal emulators? I'm using ctrl+j in vim without issues (kitty+zsh)
Good call about user-configurable key bindings, I've opened a new issue for that: #107
Turns out technically there is a distinction between key events for Enter and CtrlJ: they produce 'Carriage return' and 'Line feed' respectively.
<CR>
or carriage return, technically used to mean go to the start of the line.<NL>
, or newline aka line feed (usually calledLF
), was used to mean go to the next line. Over time, the distinction was lost in most applications.1 Pressing Enter actually yields a carriage return, usually (try pressing CtrlVEnter - you should see^M
in Unix terminals).<NL>
's control code is CtrlJ.
It's all the same to urwid though: enter
is reported for both.
Good call about user-configurable key bindings, I've opened a new issue for that: #107
Great 🙂
Turns out technically there is a distinction between key events for Enter and CtrlJ: they produce 'Carriage return' and 'Line feed' respectively.
<CR>
or carriage return, technically used to mean go to the start of the line.<NL>
, or newline aka line feed (usually calledLF
), was used to mean go to the next line. Over time, the distinction was lost in most applications.1 Pressing Enter actually yields a carriage return, usually (try pressing CtrlVEnter - you should see^M
in Unix terminals).<NL>
's control code is CtrlJ.It's all the same to urwid though:
enter
is reported for both.I see!
Would be great if one could navigate contacts panel with capital J, K :)