fix: end readline listener immediately if interrupt character is received

This commit is contained in:
charliecruzan-stripe 2023-03-08 16:58:02 -08:00 committed by GitHub
commit 45be600477
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -288,6 +288,8 @@ func (s *Select) innerRun(cursorPos, scroll int, top rune) (int, string, error)
s.list.PageUp()
case key == s.Keys.PageDown.Code || (key == 'l' && !searchMode):
s.list.PageDown()
case key == readline.CharInterrupt || key == readline.CharKill:
return nil, 0, true
default:
if canSearch && searchMode {
cur.Update(string(line))