Another attempt at making unix input work nicely