Skip to content

Commit

Permalink
Add "Ctrl+D" to list of actions which cancel the current prompt sessi…
Browse files Browse the repository at this point in the history
…on (#232)

* add "cntl-D" to list of actions which cancel the current session

* Add changelog entry

---------

Co-authored-by: Mikael Mello <[email protected]>
  • Loading branch information
mikecvet and mikaelmello authored Mar 13, 2024
1 parent 8eb6046 commit 70ded79
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## [Unreleased] <!-- ReleaseDate -->

- No changes since the latest release below.
- Pressing Ctrl+D now cancels the prompt.

## [0.7.1] - 2024-03-10

Expand Down
4 changes: 3 additions & 1 deletion inquire/src/prompts/action.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ where
Key::Enter
| Key::Char('\n', KeyModifiers::NONE)
| Key::Char('j', KeyModifiers::CONTROL) => Some(Action::Submit),
Key::Escape | Key::Char('g', KeyModifiers::CONTROL) => Some(Action::Cancel),
Key::Escape
| Key::Char('g', KeyModifiers::CONTROL)
| Key::Char('d', KeyModifiers::CONTROL) => Some(Action::Cancel),
Key::Char('c', KeyModifiers::CONTROL) => Some(Action::Interrupt),
key => I::from_key(key, config).map(Action::Inner),
}
Expand Down

0 comments on commit 70ded79

Please sign in to comment.