Fix setterm error when using non-interactive shell logins

Fix setterm error when using scp or other non-interactive logins