From 33758298cf0a4e25a3fd2459b63a05da159b69ed Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Sun, 22 Sep 2024 18:51:45 +0200 Subject: [PATCH] Allow cancelling dialogues using `CTRL+C` --- lib/modules/partition/choose-disk.fish | 1 + lib/modules/partition/confirm.fish | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/modules/partition/choose-disk.fish b/lib/modules/partition/choose-disk.fish index ad8cc38b..d10fdf99 100644 --- a/lib/modules/partition/choose-disk.fish +++ b/lib/modules/partition/choose-disk.fish @@ -29,6 +29,7 @@ function chooseDisk -a outFile message end read -lP "Your choice: " choice + or exit 1 if [ "$choice" -ge 1 ] && [ "$choice" -le "$diskCount" ] set -l disk (string split -n " " "$disks[$(math "$choice" + 1)]") diff --git a/lib/modules/partition/confirm.fish b/lib/modules/partition/confirm.fish index 6598038f..1356b1c3 100644 --- a/lib/modules/partition/confirm.fish +++ b/lib/modules/partition/confirm.fish @@ -4,6 +4,7 @@ function confirm -a message default while true read -l value -P "$message $options " + or exit 1 set value (string lower "$value") if [ -z "$value" ]