Skip to content

Using rb-readline in Windows with cygwin/mintty/git for Windows doesn't work #155

@danowar2k

Description

@danowar2k

See pry/pry#1442 (comment)

Quote:

The cause seems to be the rb-readline gem, which uses the Win32API:

    @kbhit = Win32API.new("msvcrt", "_kbhit", [], 'I')
[...]
      while (@kbhit.Call == 0)
        # If there is no input, yield the processor for other threads
        sleep(@_keyboard_input_timeout)
      end

kbhit seems to never register the keypresses when using Cygwin or miinTTY, so the rb-readline gem is always in sleep mode.

Seems to be an old problem, see here (from 2012):

http://cygwin.1069669.n5.nabble.com/kbhit-in-a-native-app-run-from-CYGWIN-console-does-not-work-td14287.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions