Comments (12)
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.
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.
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.
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.
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.
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.
TERM should be 'cygwin', not msys.
http://permalink.gmane.org/gmane.comp.gnu.mingw.msys/3612
from rb-readline.
I read below,and set environment.
http://code.google.com/p/msysgit/issues/detail?id=184
from rb-readline.
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.
I don't use bash. This is installer option.
from rb-readline.
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.
ok, I'll try it.
thanks.
from rb-readline.
Related Issues (20)
- IRB and readline with non english keyboards on Windows HOT 1
- Alt+. crashes in `_extract_last_quote` when last line is empty
- Already initialized constant warnings under Ruby 2.3.1 HOT 4
- new release HOT 4
- VI in Rails Console HOT 2
- rb-readline (0.5.3) crashes on mac_os_x / 2.3.1p112 HOT 1
- "\r" being displayed after hitting enter in rb-readline on Arch HOT 2
- Invalid byte sequence in UTF-8 when running console HOT 5
- issue deploying rails 5 application to AWS using Elastic Beanstalk due to rb-readline HOT 5
- RbReadline.rl_insert_text can not insert Chinese characters
- Officially support JRuby HOT 2
- ArgumentError when case insensitive matching is active HOT 1
- Add support for Readline.vi_editing_mode? & Readline.emacs_editing_mode? HOT 1
- Tests are randomly failing
- Using rb-readline in Windows with cygwin/mintty/git for Windows doesn't work
- Rb-readline causes the rails console to use the keyboard "↑" after typing Chinese and cannot load Chinese
- Fails when $TERM=xterm HOT 4
- Broken support for special prefixes HOT 1
- `Readline::HISTORY.delete_at(index)` not working for indices of negative values
- Encoding::UndefinedConversionError for UTF-8 to ASCII8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rb-readline.