a1ive/grub

read command does not understand <backspace> or <del> keys

Closed this issue · 5 comments

read a
type
fred[BS][BS]doris
echo $a

result:
freddoris

also cursor keys add a letter - e.g. 'K' = left or 'M' = right
DEL key adds 'S'

P.S. would also be nice to have a read -q switch (does not echo characters on screen) and a read -p switch (prints * instead of the typed character) for password entry.

I tried that but couldn't see how to call it?
https://inspired-lua.org/index.php/tag/backspace/
Could you give me a clue?

a1ive commented

now you can use 'backspace' in read command.

also cursor keys add a letter - e.g. 'K' = left or 'M' = right

bug fixed.

could also be nice to have a read -q switch (does not echo characters on screen)

use read VAR h (hide)

read -p switch (prints * instead of the typed character) for password entry.

use read VAR a (asterisk)

Thanks. Very nice! BS works
but left-cursor and right-cursor is still adding K and M
DEL is adding 'S'
image

That's got it 👍