From: Tim Pease Date: 2008-07-22T09:21:19+09:00 Subject: Re: how do i open a terminal using ruby? On Jul 21, 2008, at 6:08 PM, Philip Rutkowski wrote: > hi- > > i want to open up a terminal from ruby if it was not executed in one. > so, > > if not STDIN.isatty > #Open up a terminal > end > > do i have to use IO.popen? i would rather not because, i'm using linux > but this ruby script will also be executed on windows. how do i > account > for when to use "gnome-terminal" and when to use "cmd"? then, how do i > write to that terminal window? > I have no idea if this will work, but it's worth a shot ... Kernel.exec '/bin/bash', '-c', "ruby #{__FILE__} #{ARGV.join(' ')}" Beware the infinite recursion! Blessings, TwP