GithubHelp home page GithubHelp logo

Comments (12)

luislavena avatar luislavena commented on July 18, 2024

Sorry, but this is not a good bug report.

Please provide Ruby version, rb-readline version used (or installed by gem) and details about terminal.

If rb-readline attempted to test for stty is because you have TERM environment variable set incorrectly to something like cygwin where you do have stty

rb-readline works on Windows, I use it daily and is part of RubyInstaller, so please be more precise when report bugs or I'm going to close it out.

Thank you.

from rb-readline.

mattn avatar mattn commented on July 18, 2024

Ah, sorry. It seems working well with below's patch for me.

diff --git a/lib/rbreadline.rb b/lib/rbreadline.rb
index 9217aa9..02cf20f 100644
--- a/lib/rbreadline.rb
+++ b/lib/rbreadline.rb
@@ -1949,6 +1949,10 @@ module RbReadline
       @_rl_term_clrpag = @_rl_term_cr = @_rl_term_clreol = nil
       tty = @rl_instream ? @rl_instream.fileno : 0

+      if term == 'msys'
+         @_rl_bind_stty_chars = false
+      end
+
       if no_terminal?
          term = "dumb"
          @_rl_bind_stty_chars = false

My ruby's version is:

C:\temp\github\rb-readline>ruby -v
ruby 1.9.2p136 (2010-12-25) [i386-mingw32]

Installed from rubyinstaller.org
Thanks.

from rb-readline.

luislavena avatar luislavena commented on July 18, 2024

So you're using cygwin-like environment, msys.

Funny because my MSYS environment is setting TERM to cygwin, not msys

I would like more background on this, more precisely what are you using as terminal, how you started bash/session of this msys environment and version of rb-readline.

You're not telling me if you're using latest (0.4.0) or not, your diff is against "9217aa9" but 0.4.0 was against 0cc4cb3 (and master is 4610e69) so there is no commit relation there.

from rb-readline.

mattn avatar mattn commented on July 18, 2024

Ooops, sorry again.
I guess that some user don't have which also.

diff --git a/lib/rbreadline.rb b/lib/rbreadline.rb
index 9217aa9..b6a1206 100644
--- a/lib/rbreadline.rb
+++ b/lib/rbreadline.rb
@@ -1944,6 +1944,18 @@ module RbReadline
       @_rl_keymap = xkeymap
    end

+   def _which(prog, path=ENV['PATH'])
+     if RUBY_PLATFORM.downcase =~ /mswin(?!ce)|mingw|bccwin|cygwin/
+       path.split(File::PATH_SEPARATOR).each {|dir|
+         f = File.join(dir,prog+".exe")
+         return f if File.executable?(File.join(f)) && !File.directory?(f)
+       }
+       false
+     else
+       return system("which #{prog} > /dev/null 2>&1")
+     end
+   end
+
    def _rl_init_terminal_io(terminal_name)
       term = terminal_name ? terminal_name : ENV["TERM"]
       @_rl_term_clrpag = @_rl_term_cr = @_rl_term_clreol = nil
@@ -1954,6 +1966,8 @@ module RbReadline
          @_rl_bind_stty_chars = false
       end

+      @_rl_bind_stty_chars = false unless _which('stty')
+
       @term_string_buffer ||= 0.chr * 2032

       @term_buffer ||= 0.chr * 4080

from rb-readline.

luislavena avatar luislavena commented on July 18, 2024

Hello,

Please answer my questions so I fully understand against what are you sending your patches.

Also, if you don't have which or stty, you have a borked msys environment.

Please, again, answer my questions.

from rb-readline.

mattn avatar mattn commented on July 18, 2024

Ah, sorry again.

It is NOT broken.
I installed msysgit. and I choiced installer option 'use from command prompt' and 'don't register PATH environment'. Thus I don't have which and stty.
But one thing, I added environment variable TERM=msys. becouse less does not work correctly with no-TERM.

Thanks.

from rb-readline.

luislavena avatar luislavena commented on July 18, 2024

TERM should be 'cygwin', not msys.

http://permalink.gmane.org/gmane.comp.gnu.mingw.msys/3612

from rb-readline.

mattn avatar mattn commented on July 18, 2024

I read below,and set environment.

http://code.google.com/p/msysgit/issues/detail?id=184

from rb-readline.

luislavena avatar luislavena commented on July 18, 2024

I'm using git version 1.7.3.1.msysgit.0, using git.cmd and git log works perfectly (without the warning mentioned in the ticket)

Now, git bash tells me cygwin is the terminal, and everything works fine with RbReadline from inside a bash terminal.

So, again, this issue seems isolated to your environment, and the lack of certain tools, like which and stty, really available in git bash.

from rb-readline.

mattn avatar mattn commented on July 18, 2024

I don't use bash. This is installer option.

from rb-readline.

luislavena avatar luislavena commented on July 18, 2024

Have you tried remove TERM environment variable? or set it to cygwin?

Please see the previous comments in the msysGit issue, removing the environment variable works.

from rb-readline.

mattn avatar mattn commented on July 18, 2024

ok, I'll try it.
thanks.

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.