The problem is very specific, but I figured out the conditions for failure:

system is: Linux 3.16.0-4-686-pae #1 SMP Debian 3.16.43-2+deb8u2 (2017-06-26) i686 GNU/Linux

when i do the following set of commands:

socat -,raw,echo=0,escape=0x18,nonblock tcp:
nano somefile

Everything works, when I replace bash binary 4.3.30 with compiled 4.4.0, nano fails with error message:


Which will not go away unless I start another instance of bash. This problem exist also on Ubuntu and Kali that have bash 4.4.0 natively. I tried running socat in a subshell, in a script, perform stty sane after it, change the escape character and many other things, but to no avail. Removing nonblock or using older version of bash, however, fixes the problem (but I depend on bug fixes in 4.4 and on nonblock switch). I believe this a bug in bash and I would like to see if the hive mind has any suggestion (other than reporting the bug).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.