Getting stty: standard input: Inappropriate ioctl for device when using scp through an ssh tunnel

I got the exact same problem when I included the following line on my ~/.bashrc:

stty -ixon

The purpose of this line was to allow the use of Ctrl-s in reverse search of bash.

This link has a solution (not available)

Web Archive version of the above link

‘stty’ applies to ttys, which you have for interactive login sessions. .kshrc is executed for all sessions, including ones where stdin isn’t a tty. The solution, other than moving it to your .profile, is to make execution conditional on it being an interactive shell.

There are several ways to check for interecative shell. The following solves the problem for bash:

[[ $- == *i* ]] && stty -ixon

Leave a Comment