# which_key: Add keyboard shortcut to show pending bindings \(\#64803\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/00def035dec61f4fafceecc4aceb6f44f2c96f49)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 00def035dec61f4fafceecc4aceb6f44f2c96f49

Requested commit: 00def035dec61f4fafceecc4aceb6f44f2c96f49

Commit: 00def035dec61f4fafceecc4aceb6f44f2c96f49

Tree: 4e002634b13b31ffb7d194ab181b43f4ee55eee4

Author: Smit Barmase

Committer: GitHub

## Message

```
which_key: Add keyboard shortcut to show pending bindings (#64803)

Follow-up #63343
Depends on #64859

The pending keystrokes indicator lists the bindings that can complete a
chord, but only on hover. This PR adds `which_key::ShowPendingBindings`,
bound to `alt-/`, which opens that list from the keyboard while a chord
is pending.

For example, press `cmd-k` (`ctrl-k` on Linux/Windows), then `alt-/`.
The list opens without moving focus and stays open until the chord
completes or is cleared, even if the pointer moves away. It follows the
chord as you type, and timed chords stay paused while it's open. With no
chord pending, `alt-/` does nothing.

**Why `alt-/`?**

`/` shares a key with `?`, which is a common "help" key, and `alt-/`
isn't bound in any default or base keymap. When no chord is pending,
`alt-/` behaves as before. It only opens this popup while a chord is
pending.

On macOS, `alt-/` normally types `÷`, and it still does when no chord is
pending. The shortcut only kicks in mid-chord. The one thing we lose is
that `cmd-k` then `alt-/` used to cancel the chord and type `÷`, and now
it opens the popover instead. I think that's rare enough to be okay, and
the key can be rebound or unbound.

It can be unbound or rebound to another key. One limitation is that it
must be bound to a single keystroke. A multi-keystroke binding would
need its own pending tracking on top of the chord that's already
pending, and we don't want to add a special pending state just for this.


https://github.com/user-attachments/assets/0a26b0ad-cd7b-49d9-b466-cce54e02bf80

Release Notes:

- Added `alt-/` to show the bindings that can complete a pending
multi-keystroke shortcut.
```

## Parents

- [86c20cc9119d89b21ab8ea1cb063f40faa119736](https://git.cafe/gitcafe/zed/commit/86c20cc9119d89b21ab8ea1cb063f40faa119736?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/00def035dec61f4fafceecc4aceb6f44f2c96f49?format=markdown)
