[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Terminal messed up after exiting bash

From: Jan Rome
Subject: Terminal messed up after exiting bash
Date: Mon, 08 Sep 2014 10:17:33 +0200
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0


I'd like to report an obscure bug I came across in pfsense which runs on top of FreeBSD.

If I run a bash script in which I have

read -r -n1 -p "prompt: "

and instead of providing input, i ctrl-c the script,

the ash shell doesn't recover the terminal properly; backspace echos ^? and the only way to delete characters is to hold shift and press backspace. Also, if I use the -s switch for the read command in the bash script, the problem gets even worse with the cursor not moving anymore as I type and the text I type not being visible at all.

A solution was provided by pgas from #bash on irc.freenode.net, where I solve this by trapping the ctrl-c signal and do 'stty cooked' before exiting, which seems to give expected behaviour.

Best regards,


reply via email to

[Prev in Thread] Current Thread [Next in Thread]