# gpui: Improve \`window.prompt\` to support ESC with non-English cancel text on macOS \(\#29538\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 047e7eacec0987a06d395d6698e3f0d9fef4e6b6

Requested commit: 047e7eacec0987a06d395d6698e3f0d9fef4e6b6

Commit: 047e7eacec0987a06d395d6698e3f0d9fef4e6b6

Tree: b22ab32c982ce8ce60f75782734414c8b9349761

Author: Jason Lee

Committer: GitHub

## Message

```
gpui: Improve `window.prompt` to support ESC with non-English cancel text on macOS (#29538)

Release Notes:

- N/A

----

The before version GPUI used `Cancel` for cancel text, if we use
non-English text (e.g.: "取消" in Chinese), then the press `Esc` to cancel
will not work.

So this PR to change it by use `PromptButton` to instead the `&str`,
then we can use `PromptButton::cancel("取消")` for the `Cancel` button.

Run `cargo run -p gpui --example window` to test.

---

Platform Test:

- [x] macOS
- [x] Windows
- [x] Linux (x11 and Wayland)

---------

Co-authored-by: Mikayla Maki <mikayla@zed.dev>
Co-authored-by: Mikayla Maki <mikayla.c.maki@gmail.com>
```

## Parents

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

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