Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Have to press <C-v> twice #71

Closed
rockyzhang24 opened this issue Jan 22, 2021 · 4 comments
Closed

Have to press <C-v> twice #71

rockyzhang24 opened this issue Jan 22, 2021 · 4 comments
Labels
mac In macOS environment

Comments

@rockyzhang24
Copy link

rockyzhang24 commented Jan 22, 2021

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.

@kevinhwang91
Copy link
Owner

kevinhwang91 commented Jan 22, 2021

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.

@kevinhwang91 kevinhwang91 added the mac In macOS environment label Jan 22, 2021
@rockyzhang24
Copy link
Author

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.

@kevinhwang91
Copy link
Owner

Sure, I will add it to README later.

@sethidden
Copy link

sethidden commented Mar 19, 2022

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)

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mac In macOS environment
Projects
None yet
Development

No branches or pull requests

3 participants