The redirection works (except for pipe which id didn't write yet)
for some reason the return to defaults function donsen't work for
me (I wrote it in 5 minutes and don't have the time to check it)