-
Notifications
You must be signed in to change notification settings - Fork 33
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
ANSI::Terminal fails to detect Windows #12
Comments
Bump! No love for windows, anyone? |
I have run into this issue on Windows as well, might take a stab at fixing it. |
+1 |
I would love to merge a fix. I do not use Windows (for development) so it would be better for someone who does to take a stab at it. |
I may have fixed it. All this time and I think the simple error was |
require "ansi"
ANSI::Terminal.terminal_width # => 207 now works for me on Win7 under Cygwin. Is that a conclusive test? |
Pretty much. And if that works for straight Windows (no Cygwin) then I think this issue if finally close able. Yay! (Though I am sure improvements are to be had, e.g. I've seen code in the wild that indicate to me that JRuby support might need some love.) |
I am on Windows XP.
When I type:
I have the message:
No such file or directory - stty size
In https://github.com/rubyworks/ansi/blob/master/lib/ansi/terminal.rb, the code seems to require successively
ansi/terminal/stty
,ansi/terminal/curses
,ansi/terminal/termios
andansi/terminal/win32
until one of these require does not raises.I guess that
stty
is supposed to raise on Windows, to avoid using this library. However when I require manuallyansi/terminal/stty
, it does not raises.In fact, when I read the code of
ansi/terminal/stty
I do not see anything that can raise on Windows (or on any platform).The text was updated successfully, but these errors were encountered: