STDIN/STDOUT "not a tty" under Kernel.system
--------------------------------------------
Key: JRUBY-1608
URL: http://jira.codehaus.org/browse/JRUBY-1608
Project: JRuby
Issue Type: Bug
Components: Core Classes/Modules
Environment: MAC OS X Tiger. Java 1.5.0_07. JRuby says: "ruby 1.8.5
(2007-11-22 rev 4842) [ppc-jruby1.1b1]".
Reporter: Johan Holmberg
A program started with Kernel.system does not get the same STDIN/STDOUT as
JRuby had when it started. This can be shown with the following example:
$ jruby -e 'system "tty"'
not a tty <--- Note this output
$ ruby -e 'system "tty"'
/dev/ttyp1
MRI passes on its original STDOUT/STDERR to the tty(1) program. JRuby does not.
To further demonstrate this problem a simple Ruby script "is-a-tty" like below
can be used:
---------- is-a-tty ---------------
#!/usr/local/bin/ruby
def report_tty(name, f)
puts "%-6s is%s a tty" % [name, f.tty? ? "" : " NOT"]
end
report_tty "STDIN", STDIN
report_tty "STDOUT", STDOUT
report_tty "STDERR", STDERR
-------------------------
If I run this with JRuby and MRI I get:
$ jruby -e 'system "./is-a-tty"'
STDIN is NOT a tty
STDOUT is NOT a tty
STDERR is NOT a tty
$ ruby -e 'system "./is-a-tty"'
STDIN is a tty
STDOUT is a tty
STDERR is a tty
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email