GithubHelp home page GithubHelp logo

Comments (10)

rdp avatar rdp commented on July 18, 2024

the offending code seems to be
class Win32API
...
@func = DL::CFunc.new(handle[func], TYPEMAP[export.tr("VPpNnLlIi", "0SSI")], func)
...
ret, = @func.call(args)

does this mean that win32api is the cause, i wonder?

from rb-readline.

luislavena avatar luislavena commented on July 18, 2024

Can you provide a detailed use case? Please, I'm not expert on the code so need test cases to verify and investigate solutions.

from rb-readline.

rdp avatar rdp commented on July 18, 2024

certainly.

RbReadline::RB_READLINE_VERSION
=> "0.1.2"
Thread.new { loop { sleep 1; puts '.'; } }
=> #<Thread:0x29ed640 sleep>

Now dots from that thread should appear once per second--you'll notice that they don't. That's about it.

from rb-readline.

luislavena avatar luislavena commented on July 18, 2024

Neither does a normal program until you do Thread#join.

Anyhow, this is related to the scan of events from the keyboard.

Can you test this over Linux/OSX? Tools like Highline and AFAIK GNU Readline suffered the same.

from rb-readline.

rdp avatar rdp commented on July 18, 2024

Interesting. Linux 1.8.7 with pure ruby seems to not have this problem. Linux 1.8.7 with gnu readline seems to not have it, either.

windows seems to have the problem with both gnu readline and pure ruby readline.

Thankfully it's not a problem that people really care about. I think it's more of a feature request for the win32api people [?]

from rb-readline.

luislavena avatar luislavena commented on July 18, 2024

Actually is a known threading issue with Ruby and Windows. win32utils guys worked on a patch for Ruby's select() that never got integrated.

from rb-readline.

rdp avatar rdp commented on July 18, 2024

gotcha--it's a problem that select in doze by default can't handle stdin or what not. anyway I made the request to the win32 guys so it's up to them now.
Thanks!
-r

from rb-readline.

rdp avatar rdp commented on July 18, 2024

I believe this is more of a core problem

from rb-readline.

luislavena avatar luislavena commented on July 18, 2024

Hello, is this still valid on current releases of RubyInstaller and master?

Please update this with your testing.

Going to close this if no update is given.

Thank you.

from rb-readline.

luislavena avatar luislavena commented on July 18, 2024

Hello,

Latest rb-readline already support this:

require 'readline'

Thread.new { loop { sleep 1; print '.' } }

loop do
  line = Readline::readline('> ')
  Readline::HISTORY.push(line)
  puts "You typed: #{line}"
  break if line == 'quit'
end

Works properly.

Closing this out.

from rb-readline.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.