Timeline for Press SPACE to continue (not ENTER)
Current License: CC BY-SA 4.0
5 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Oct 18, 2020 at 14:39 | comment | added | PM 2Ring | @adazem009 On the negative side of things, read is painfully inefficient: it makes a system call for each character it reads (which is kind of why it can do this trick of reading a space without needing Enter). For more reasons to avoid using read unless you have no other option, please see Stéphane's excellent answer here: unix.stackexchange.com/q/169716/88378 | |
| Oct 17, 2020 at 9:28 | comment | added | Oskar Skog | @adazem009 No, I was asking about buffering not echoing. The man page for bash's read doesn't clearly mention it but it obviously works without waiting for a line feed. | |
| Oct 17, 2020 at 7:55 | vote | accept | adazem009 | ||
| Oct 17, 2020 at 7:54 | comment | added | adazem009 | Wow! Thank you. This is what I was looking for. @OskarSkog If you mean if it'll show what you're typing, then yes, this will show the keys you're pressing in the terminal, but you can disable it by adding -s flag, like read -s -d ' ' (you don't need the key variable here, if you only want it to wait for the space key) | |
| Oct 17, 2020 at 7:17 | history | answered | Cyrus | CC BY-SA 4.0 |