delano / rye

Safe, parallel access to Unix shells from Ruby
http://delano.github.com/rye
MIT License
235 stars 32 forks source link

Using rbox.execute('....some shell cmd with output....') leads to stty annoyances on ubuntu 12.04 and 14.04 #57

Closed derjohn closed 1 year ago

derjohn commented 10 years ago

The output of the command contains 'stty: standard input: Inappropriate ioctl for device'

That's annoying and doesnt happen if I use ssh with the same command on the same machines.

delano commented 10 years ago

Thanks I appreciate input. Happy to accept a pull request that resolves the issue.

derjohn commented 10 years ago

Actually I have to real idea how to fix that. I wonder, if others users don't see that problem, too?

I think what happens in the background is that stty is called, which throws that warning, like in this example:

echo foo | ruby -e 'system("stty -echo")' stty: standard input: Inappropriate ioctl for device

derjohn commented 10 years ago

Hm, it looks like the line @rye_stty_save = stty -g.chomp rescue nil is causing the issue. I dont see, where #@rye_stty_save in the code is ever used again. Should I simply drop those lines or make it silentby calling 'stty -g 2>/dev/null' ?

BTW: The same issue happens if you make a ssh myserver 'stty -g' , so it might have to do with the particular version of stty.