[英]backspace does not remove tput command's underline in bash
我正在努力练习做一个漂亮而整洁的界面。 但是,我被这个问题困住了。 我试图强调我使用这种方法设法做到的用户的输入
echo -n "Title : "; read -p "$(tput smul)" getTitle; tput rmul
tput smul
用于在单词下划线,而tput rmul
用于在此语句成功后删除下划线。
不幸的是,当我不小心输入错误并决定退格时,下划线并没有相应地消失。
相反,即使我删除了所有用户输入,下划线仍然存在。
有什么解决办法吗?
通过-e
标志使用readline
:
echo -n "Title : "; read -ep "$(tput smul)" getTitle; tput rmul
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.