From 9ff866a6592b02b8fa4e6b3d86ffcff7599b1ba3 Mon Sep 17 00:00:00 2001 From: Samuel Lucas <63159663+samuel-lucas6@users.noreply.github.com> Date: Sun, 11 Aug 2024 15:48:27 +0100 Subject: [PATCH] PassphrasePrompt.cs: Support the delete key. --- src/Kryptor/UI/PassphrasePrompt.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Kryptor/UI/PassphrasePrompt.cs b/src/Kryptor/UI/PassphrasePrompt.cs index e75dd7c..e8f671b 100644 --- a/src/Kryptor/UI/PassphrasePrompt.cs +++ b/src/Kryptor/UI/PassphrasePrompt.cs @@ -86,7 +86,7 @@ private static Span GetPassphrase() if (!char.IsControl(consoleKeyInfo.KeyChar)) { passphrase.Add(consoleKeyInfo.KeyChar); } - else if (consoleKeyInfo.Key == ConsoleKey.Backspace && passphrase.Count > 0) { + else if (consoleKeyInfo.Key is ConsoleKey.Backspace or ConsoleKey.Delete && passphrase.Count > 0) { passphrase.RemoveAt(passphrase.Count - 1); } }