Terminal messed up after exiting bash

2014-09-08 Thread Jan Rome
Hello, 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

Re: read -e does not restore terminal settings correctly when interrupted if a trap is set

2014-09-08 Thread Chet Ramey
On 9/7/14, 6:40 PM, micka...@gmail.com wrote: > Bash Version: 4.3 > Patch Level: 24 > Release Status: release > > Description: > Given the following script (test.sh) : > > #!/bin/bash > cleanup() { :; } > trap cleanup 0 > read -e dummy > > Run the script ('ba

Re: read -e does not restore terminal settings correctly when interrupted if a trap is set

2014-09-08 Thread Mickaƫl THOMAS
Yep, that fixed the problem, thank you ! 2014-09-08 20:46 GMT+02:00 Chet Ramey : > On 9/7/14, 6:40 PM, micka...@gmail.com wrote: > >> Bash Version: 4.3 >> Patch Level: 24 >> Release Status: release >> >> Description: >> Given the following script (test.sh) : >> >> #!/bin/bash >>

Re: Trap not being run for all CHLD signals, 4.3

2014-09-08 Thread Chet Ramey
On 9/3/14, 10:08 AM, crispusfairba...@gmail.com wrote: > $ cat parallel-test.bash > function process_job { > sleep 1 > } > > function main { > typeset -i index=0 cur_jobs=0 max_jobs=6 > trap '((cur_jobs--))' CHLD > set -m > > while ((index++ < 30)); do > echo -n "index

Re: Terminal messed up after exiting bash

2014-09-08 Thread Ryan Cunningham
This isn't clear to me. Are you using the Almquist Shell to execute BASH to run your script, or is BASH already running when the script is executed? -- Sent from my iPad > On Sep 8, 2014, at 1:17 AM, Jan Rome wrote: > > Hello, > > I'd like to report an obscure bug I came across in pfsense wh

Re: RFE: remove duplicate entries from the result of `compgen -W'

2014-09-08 Thread Clark Wang
On Mon, Sep 8, 2014 at 1:07 AM, Chet Ramey wrote: > On 9/4/14, 10:33 PM, Clark Wang wrote: > > See following example: > > > > $ echo $BASH_VERSION > > 4.3.18(1)-release > > $ compgen -W 'hello hello' h > > hello > > hello > > $ > > > > It'll be good if only one "hello" is outputted. >