Add -k flag to display-popup which allows any key to dismiss the popup

once the command has exited. From Meriel Luna Mittelbach in GitHub issue
4612.
This commit is contained in:
nicm
2025-09-01 08:03:07 +00:00
parent cfb906a0ce
commit 5c89d835a6
4 changed files with 18 additions and 7 deletions

View File

@ -549,6 +549,9 @@ popup_key_cb(struct client *c, void *data, struct key_event *event)
pd->job == NULL) &&
(event->key == '\033' || event->key == ('c'|KEYC_CTRL)))
return (1);
if (pd->job == NULL && (pd->flags & POPUP_CLOSEANYKEY) &&
!KEYC_IS_MOUSE(event->key) && !KEYC_IS_PASTE(event->key))
return (1);
if (pd->job != NULL) {
if (KEYC_IS_MOUSE(event->key)) {
/* Must be inside, checked already. */