I'm trying your modified version, it seems that it doesn't work cause the osso-xterm windows don't have root access (solved by adding a "sudo" in front of the commands, I have sudser installed); using sudo works pretty well, but it can't correctly kill the processes when closing. Thanks everyone for the hard work
osso-xterm -e "ash -c 'sudo somecommand;read foo;exit;'"
root_term(command){ osso-xterm -e "ash -c 'sudo $command;read foo;exit;'"}