kamiyaa / joshuto

ranger-like terminal file manager written in Rust
https://crates.io/crates/joshuto
GNU Lesser General Public License v3.0
3.35k stars 151 forks source link

why I can't bind ctrl-j to other command, the ctrl-j can only be {open: } #469

Open 0xnofoot opened 7 months ago

0xnofoot commented 7 months ago
截屏2023-12-09 21 22 49

the ctrl+j doesn't work

DLFW commented 6 months ago

I can reproduce the problem. Seems like a bug.

I configured

keymap = [
...
  { keys = ["ctrl+k"], commands = ["parent_cursor_move_up"] },
  { keys = ["ctrl+j"], commands = ["parent_cursor_move_down"] },
...
]

ctrl+k does what is expected, but ctrl+j really opens the file.

I also tried the older version v0.9.5, which cannot parse my current configuration, and it it also opens files with ctrl+j.

0xnofoot commented 6 months ago

yes,hope author could fix it

kamiyaa commented 6 months ago

Did a bit of research online and it appears that Ctrl+J is handled differently by readline/bash etc.

So to joshuto, it looks like you pressed enter.

JosefLitos commented 6 months ago

There are many ways and good libraries to handle term input correctly. If joshuto isn't using one or is using ncurses, than that is just unfortunate. Notcurses is a good example of a modern lib intended for tui apps.