1
0
mirror of https://codeberg.org/kiss-community/kiss synced 2024-12-21 22:50:07 -07:00

kiss: use dd for prompt (#106)

use dd for prompt since it will always exit upon receiving SIGINT
signal, unlike the read builtin, which, as permitted by POSIX, can
ignore this signal.

Reviewed-on: https://codeberg.org/kiss-community/kiss/pulls/106
Co-authored-by: illiliti <illiliti@protonmail.com>
Co-committed-by: illiliti <illiliti@protonmail.com>
This commit is contained in:
illiliti 2022-10-29 09:03:06 +02:00 committed by Pratham
parent a27fcec564
commit 3309146e61

6
kiss
View File

@ -93,10 +93,8 @@ tmp_file_copy() {
prompt() {
null "$1" || log "$1"
log "Continue?: Press Enter to continue or Ctrl+D to abort"
# korn-shell does not exit on interrupt of read.
equ "$KISS_PROMPT" 0 || read -r _ || exit 1
log "Continue?: Press Enter to continue or Ctrl+C to abort"
equ "$KISS_PROMPT" 0 || dd ibs=1 count=1 >/dev/null 2>&1 || exit 1
}
mkcd() {