kevinhwang91/rnvimr

Have to press <C-v> twice

rockyzhang24 opened this issue · 4 comments

Hi,
I am using the default settings, i.e., <C-v> for vsplit. However, I have to press <C-v> twice consecutively to open a vsplit window. Pressing only once doesn't work, i.e., nothing happens.

I double-checked I don't have such a keymapping in ranger's rc.conf, and also no such mapping in my nvim settings.

BTW, both <C-x> and <C-t> work well.

Any ideas? Thank you very much.

Yes, I can reproduce in macos. ranger uses curses, I guess it's caused by terminfo.

In the below snippet code, the first type of ctrl-v doesn't show the key.

import time
import curses


def main(stdscr):
    begin_x, begin_y = 0, 0
    width, height = 40, 20
    win = curses.newwin(height, width, begin_y, begin_x)
    win.scrollok(True)
    while True:
        k = win.getch()
        win.addstr(f'key {str(k)} typed.\n')
        win.refresh()
        time.sleep(0.1)


if __name__ == "__main__":
    print(curses.wrapper(main))

In short, it's macos's upstream bug.

You can remap the extra actions as a workaround, run :h rnvimr_action for detail.

I'm sorry that I couldn't solve this issue.

Okay, I got it. Thanks. By the way, you can mention this issue for macOS users in the README, the "advanced configuration" section which has rnvimr_action example there.

Sure, I will add it to README later.

Can you check if typing in your terminal stty lnext undef then launching nvim and trying CTRL+V fixes it? If it fixes it, add the stty snippet to your ~/.bashrc or ~/.zshrc

Courtesy of jonas/tig#314 (comment)