bug-bash
[Top][All Lists]
Advanced

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

bash bug with read -s command


From: Richard W. Marsden
Subject: bash bug with read -s command
Date: Sun, 21 Dec 2014 15:28:01 -0500

steps to produce

hide cursor
    setterm -cursor off

call the bash built-in read command as follows: silent, wait 1 second, read 1 character to variable KEY
    read -s -t 1 -n 1 KEY

while the read command is in a loop, control + c is trapped successfully and the cursor is un-hidden
    setterm -cursor on

expected results:
    cursor is visible and typed keys are echoed to screen as before

actual results:
    cursor is visible, keys are no-longer echoed to the screen until terminal is closed

additional notes
    command: setterm -default cannot fix
    os: fedora 21
    bash version: bash-4.3.30-2.fc21.x86_64
    tested in various terminal emulators, and the console (alt+Fn, where n=1-8)

workaround
    remove silent -s from read command

sample script
    http://pastebin.com/EhCNaWmT



  

reply via email to

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