tidely
8ab7d44d51
terminal: Match trait bounds with terminal input ( #31441 )
...
The core change here is the following:
```rust
fn write_to_pty(&self, input: impl Into<Vec<u8>>);
// into
fn write_to_pty(&self, input: impl Into<Cow<'static, [u8]>>);
```
This matches the trait bounds that's used by the Alacritty crate. We are
now allowed to effectively pass `&'static str` instead of always needing
a `String`.
The main benefit comes from making the `to_esc_str` function return a
`Cow<'static, str>` instead of `String`. We save an allocation in the
following instances:
- When the user presses any special key that isn't alphanumerical (in
the terminal)
- When the uses presses any key while a modifier is active (in the
terminal)
- When focusing/un-focusing the terminal
- When completing or undoing a terminal transaction
- When starting a terminal assist
This basically saves us an allocation on **every key** press in the
terminal.
NOTE: This same optimization can be done for **nearly all** keypresses
in the entirety of Zed by changing the signature of the `Keystroke`
struct in gpui. If the Zed team is interested in a PR for it, let me
know.
Release Notes:
- N/A
2025-06-02 21:12:28 -06:00
..
2025-05-29 01:58:40 +00:00
2025-06-02 21:12:28 -06:00
2025-06-02 15:12:41 +00:00
2025-05-22 21:00:54 +00:00
2025-05-16 05:04:36 -04:00
2025-05-20 23:06:07 +00:00
2025-06-02 22:19:09 +00:00
2025-05-21 09:27:54 +00:00
2025-05-26 11:48:50 -04:00
2025-05-28 18:44:49 +00:00
2025-05-30 08:28:22 -07:00
2025-05-26 21:20:41 -03:00
2025-05-28 11:51:21 -04:00
2025-05-20 23:06:07 +00:00
2025-05-30 08:29:52 +00:00
2025-04-02 13:26:34 -07:00
2025-05-27 10:54:42 +02:00
2025-05-30 08:32:54 -07:00
2025-05-26 11:48:50 -04:00
2025-05-26 23:04:31 -04:00
2025-05-26 23:04:31 -04:00
2025-05-20 23:06:07 +00:00
2025-05-26 23:04:31 -04:00
2025-05-04 08:28:39 +00:00
2025-05-31 19:38:32 -04:00
2025-06-02 22:19:09 +00:00
2025-04-02 13:26:34 -07:00
2025-05-26 23:04:31 -04:00
2025-04-02 13:26:34 -07:00
2025-05-14 23:29:11 +02:00
2025-05-26 10:29:45 +02:00
2025-05-30 21:28:31 +02:00
2025-04-02 13:26:34 -07:00
2025-05-30 22:37:40 +00:00
2025-05-30 23:08:41 +02:00
2025-05-20 00:20:00 +00:00
2025-05-22 07:24:46 -04:00
2025-05-14 11:15:27 +02:00
2025-06-02 21:14:30 -04:00
2025-05-20 23:06:07 +00:00
2025-05-26 23:04:31 -04:00
2025-05-27 16:56:03 +00:00
2025-06-03 02:37:06 +00:00
2025-06-02 21:57:42 -03:00
2025-05-26 16:06:38 +02:00
2025-05-26 16:06:38 +02:00
2025-05-20 23:06:07 +00:00
2025-06-02 22:19:09 +00:00
2025-05-29 22:07:34 +00:00
2025-05-17 16:42:45 +00:00
2025-05-23 14:53:53 +00:00
2025-06-02 09:54:15 -03:00
2025-04-02 13:26:34 -07:00
2025-05-20 23:06:07 +00:00
2025-04-02 13:26:34 -07:00
2025-05-12 14:43:14 +00:00
2025-05-26 11:31:25 +00:00
2025-05-20 23:06:07 +00:00
2025-05-29 20:43:12 +00:00
2025-05-07 23:11:09 +03:00
2025-05-27 10:54:42 +02:00
2025-06-02 13:22:36 -06:00
2025-05-26 17:43:57 +00:00
2025-04-02 13:26:34 -07:00
2025-04-02 13:26:34 -07:00
2025-05-20 23:06:07 +00:00
2025-04-02 13:26:34 -07:00
2025-05-30 18:18:23 -03:00
2025-05-20 23:06:07 +00:00
2025-05-20 23:06:07 +00:00
2025-05-20 23:06:07 +00:00
2025-05-27 21:52:42 +00:00
2025-06-02 22:19:09 +00:00
2025-05-20 23:06:07 +00:00
2025-05-17 16:42:45 +00:00
2025-05-17 16:42:45 +00:00
2025-04-23 20:54:09 +00:00
2025-06-02 16:29:06 +00:00
2025-05-08 14:01:39 +02:00
2025-05-29 20:43:12 +00:00
2025-06-02 15:12:41 +00:00
2025-05-20 23:06:07 +00:00
2025-06-03 02:12:58 +00:00
2025-06-02 16:29:06 +00:00
2025-05-20 23:06:07 +00:00
2025-05-20 23:06:07 +00:00
2025-05-26 13:54:17 +02:00
2025-05-26 11:48:50 -04:00
2025-05-29 21:41:15 +00:00
2025-05-30 08:29:52 +00:00
2025-05-20 23:06:07 +00:00
2025-04-29 21:58:45 -03:00
2025-05-30 08:10:12 -03:00
2025-05-22 14:22:35 -04:00
2025-06-02 17:35:00 +00:00
2025-05-21 21:17:14 +03:00
2025-05-14 23:29:11 +02:00
2025-06-02 15:12:41 +00:00
2025-05-26 11:46:35 +00:00
2025-05-26 23:04:31 -04:00
2025-05-26 23:04:31 -04:00
2025-04-02 13:26:34 -07:00
2025-06-02 21:24:08 +00:00
2025-05-29 12:55:47 +00:00
2025-05-20 23:06:07 +00:00
2025-06-02 21:12:28 -06:00
2025-05-26 23:04:31 -04:00
2025-05-26 23:04:31 -04:00
2025-05-20 23:06:07 +00:00
2025-06-02 22:19:09 +00:00
2025-05-29 09:24:39 +05:30
2025-05-26 17:43:57 +00:00
2025-05-23 14:53:53 +00:00
2025-05-27 16:56:27 +00:00
2025-06-02 22:19:09 +00:00
2025-06-02 16:29:06 +00:00
2025-05-20 23:06:07 +00:00
2025-04-02 13:26:34 -07:00
2025-05-26 11:48:50 -04:00
2025-05-26 11:48:50 -04:00
2025-05-29 20:43:12 +00:00
2025-04-02 13:26:34 -07:00
2025-05-26 23:04:31 -04:00
2025-05-29 20:43:12 +00:00
2025-05-20 23:06:07 +00:00
2025-04-25 17:41:49 +03:00
2025-06-02 21:24:08 +00:00
2025-05-27 14:14:25 -04:00
2025-05-20 23:06:07 +00:00
2025-05-26 23:04:31 -04:00
2025-05-26 13:44:09 +00:00
2025-05-20 23:06:07 +00:00
2025-04-02 13:26:34 -07:00
2025-05-16 17:35:44 +02:00
2025-05-20 23:06:07 +00:00
2025-05-01 17:37:43 +02:00
2025-05-26 11:48:50 -04:00
2025-04-02 13:26:34 -07:00
2025-05-23 20:45:32 +00:00
2025-05-29 16:09:07 +00:00
2025-05-30 14:32:59 +02:00
2025-05-30 19:28:56 +00:00
2025-04-02 13:26:34 -07:00
2025-04-21 21:30:21 -07:00
2025-06-02 21:12:28 -06:00
2025-06-02 21:12:28 -06:00
2025-05-28 12:32:54 +00:00
2025-05-26 18:23:41 +00:00
2025-04-02 13:26:34 -07:00
2025-05-26 18:23:41 +00:00
2025-05-30 20:37:38 +00:00
2025-05-06 10:18:48 +00:00
2025-05-30 17:13:50 +00:00
2025-06-02 16:29:06 +00:00
2025-05-29 21:41:15 +00:00
2025-05-14 23:29:11 +02:00
2025-05-23 19:31:25 +00:00
2025-05-30 15:26:27 +00:00
2025-05-28 10:16:34 -04:00
2025-05-01 19:24:14 +00:00
2025-06-02 13:18:28 -06:00
2025-04-23 20:54:09 +00:00
2025-04-23 15:30:20 +00:00
2025-05-20 23:06:07 +00:00
2025-05-29 15:20:58 -04:00
2025-06-03 00:59:36 +00:00
2025-05-26 23:04:31 -04:00
2025-06-03 01:26:41 +00:00
2025-05-26 19:40:07 +00:00
2025-05-26 11:48:50 -04:00
2025-06-02 13:22:32 +00:00
2025-04-23 20:54:09 +00:00