I was wondering whether it is possible to have a ruby script open a new terminal window and redirect its output to that newly-opened terminal window.
To open a new terminal, I currently do system("gnome-terminal")
, however, after researching for a while, I still dont know how I could achieve the following ("pseudo code"):
variable = "test"
newTerminal = system("gnome-terminal")
puts variable to newTerminal
Is that even possible without going through major troubles?
I can't easily test this for your system, but I'd try using IO.popen to open the terminal, which should allow you to write to the IO stream returned.