Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: JRuby 1.1.1
-
Fix Version/s: None
-
Component/s: Core Classes/Modules
-
Labels:None
-
Environment:MAC OS X Tiger. Java 1.5.0_07. JRuby says: "ruby 1.8.5 (2007-11-22 rev 4842) [ppc-jruby1.1b1]".
-
Number of attachments :
Description
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
Issue Links
- is depended upon by
-
JRUBY-5523
jruby's system("ls") seems to behave different than MRI
-
- is duplicated by
-
JRUBY-5523
jruby's system("ls") seems to behave different than MRI
-
-
JRUBY-5715
STDIN/STDOUT/STDERR of a process started with Kernel#exec or Kernel#system are not TTY (but with MRI it is)
-
Activity
Charles Oliver Nutter
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Affects Version/s | JRuby 1.1.1 [ 14157 ] |
Charles Oliver Nutter
made changes -
| Link |
This issue is depended upon by |
Charles Oliver Nutter
made changes -
| Link |
This issue is duplicated by |
Hiro Asari
made changes -
| Link |
This issue is duplicated by |
Charles Oliver Nutter
made changes -
| Fix Version/s | JRuby 1.7.1 [ 18842 ] |
Charles Oliver Nutter
made changes -
| Description |
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 |
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:
{noformat} $ jruby -e 'system "tty"' not a tty <--- Note this output $ ruby -e 'system "tty"' /dev/ttyp1 {noformat} 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: {noformat} ---------- 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 ------------------------- {noformat} If I run this with JRuby and MRI I get: {noformat} $ 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 {noformat} |
Thomas E Enebo
made changes -
| Fix Version/s | JRuby 1.7.2 [ 19008 ] | |
| Fix Version/s | JRuby 1.7.1 [ 18842 ] |
Thomas E Enebo
made changes -
| Fix Version/s | JRuby 1.7.3 [ 19009 ] | |
| Fix Version/s | JRuby 1.7.2 [ 19008 ] |
Thomas E Enebo
made changes -
| Fix Version/s | JRuby 1.7.4 [ 19106 ] | |
| Fix Version/s | JRuby 1.7.3 [ 19009 ] |
Charles Oliver Nutter
made changes -
| Fix Version/s | JRuby 1.7.4 [ 19106 ] |