jarun / nnn

n³ The unorthodox terminal file manager
BSD 2-Clause "Simplified" License
18.51k stars 743 forks source link

Keybind collision when using the colemak patch #1876

Closed thomashoullier closed 1 month ago

thomashoullier commented 2 months ago

Environment details

I compiled the latest nnn package revision from the gentoo repository with the colemak USE flag which enables the Colemak patch.

I noticed the keybind for SEL_NEW in the patch (to the key c) clashed with the vanilla keybind for SEL_REMOTE (also set to c). This collision is detected by nnn -K. When I ran nnn, the c key was bound to SEL_REMOTE and I could not access the "create" feature.

I solved the problem on my installation by adding my own patch which removes the binding for SEL_REMOTE entirely. I don't think this solution is applicable to all colemak users. Maybe the colemak bindings patch needs to be adjusted so that both SEL_REMOTE and SEL_NEW are accessible?

Note the gentoo maintainers apply another patch to this patch, as seen here. I am not sure what this is about, but it seems related to the keybinds documentation only. This is probably a separate issue.

N-R-K commented 2 months ago

I can reproduce:

$ ./nnn -K          
key collision! [^M]
key collision! [c]

@jacmoe what do you suggest?

Note the gentoo maintainers apply another patch to this patch, as seen here.

AFAIK that's backporting a fix in master. It's unrelated to your issue.

N-R-K commented 2 months ago

@thomashoullier do you (or any other colemak user) have any suggestion on what to change here?

Darukutsu commented 2 months ago

I use colemak-dh so h(as host) is ok for me. But that would clash with classic colemak. I suggest make it capital C.

thomashoullier commented 2 months ago

Thank you for the responses. I have no suggestion to make as I am not running colemak per-se and rebind many keys using my own patch. I simply noticed your colemak patch created the key collision in question and wanted to warn about the problem.

N-R-K commented 1 month ago

@Darukutsu any suggestion for Ctrl+m (filter mode)?

(EDIT: went with Ctrl+k for it.)