ZIm/crates/project/src
Thorsten Ball 69e698c3be
terminal: Fix blinking settings & blinking with custom shape (#18538)
This is a follow-up to #18530 thanks to this comment here:
https://github.com/zed-industries/zed/pull/18530#issuecomment-2382870564

In short: it fixes the `blinking` setting and the `cursor_shape` setting
as it relates to blinking.

Turns out our `blinking` setting was always the wrong value when using
`terminal_controlled` and the terminal _would_ control the blinking.

Example script to test with:

```bash
echo -e "0 normal \x1b[\x30 q"; sleep 2
echo -e "1 blink block \x1b[\x31 q"; sleep 2
echo -e "2 solid block \x1b[\x32 q"; sleep 2
echo -e "3 blink under \x1b[\x33 q"; sleep 2
echo -e "4 solid under \x1b[\x34 q"; sleep 2
echo -e "5 blink vert \x1b[\x35 q"; sleep 2
echo -e "6 solid vert \x1b[\x36 q"; sleep 2
echo -e "0 normal \x1b[\x30 q"; sleep 2

echo -e "color \x1b]12;#00ff00\x1b\\"; sleep 2
echo -e "reset \x1b]112\x1b\\ \x1b[\x30 q"
```

Before the changes in here, this script would set the cursor shape and
the blinking, but the blinking boolean would always be wrong.

This change here makes sure that it works consistently:

- `terminal.cursor_shape` only controls the *default* shape of the
terminal, not the blinking.
- `terminal.blinking = on` means that it's *always* blinking, regardless
of what terminal programs want
- `terminal.blinking = off` means that it's *never* blinking, regardless
of what terminal programs want
- `terminal.blinking = terminal_controlled (default)` means that it's
blinking depending on what terminal programs want. when a terminal
program resets the cursor to default, it sets it back to
`terminal.cursor_shape` if that is set.

Release Notes:

- Fixed the behavior of `{"terminal": {"blinking":
"[on|off|terminal_controlled]"}` to work correctly and to work correctly
when custom `cursor_shape` is set.
- `terminal.cursor_shape` only controls the *default* shape of the
terminal, not the blinking.
- `terminal.blinking = on` means that it's *always* blinking, regardless
of what terminal programs want
- `terminal.blinking = off` means that it's *never* blinking, regardless
of what terminal programs want
- `terminal.blinking = terminal_controlled (default)` means that it's
blinking depending on what terminal programs want. when a terminal
program resets the cursor to default, it sets it back to
`terminal.cursor_shape` if that is set.

Demo:


https://github.com/user-attachments/assets/b3fbeafd-ad58-41c8-9c07-1f03bc31771f

Co-authored-by: Bennet <bennet@zed.dev>
2024-09-30 15:36:35 +02:00
..
lsp_command use ssh lsp store (#17655) 2024-09-10 15:51:01 -04:00
buffer_store.rs Rebuild buffer store to be aware of remote/local distinction (#18303) 2024-09-24 14:52:30 -07:00
connection_manager.rs chore: Fix several style lints (#17488) 2024-09-06 11:58:39 +02:00
debounced_delay.rs chore: Fix several style lints (#17488) 2024-09-06 11:58:39 +02:00
environment.rs Don't stop loading the env if direnv call fails (#18473) 2024-09-30 09:54:22 +03:00
lsp_command.rs Rebuild buffer store to be aware of remote/local distinction (#18303) 2024-09-24 14:52:30 -07:00
lsp_ext_command.rs Fix renames over language server for SSH remoting (#17897) 2024-09-16 16:20:17 -06:00
lsp_store.rs settings: Make external formatter arguments optional (#18340) 2024-09-30 09:34:41 +03:00
prettier_store.rs Allow using system node (#18172) 2024-09-23 15:28:04 -06:00
project.rs project: Fix worktree store event missing in remote projects (#18376) 2024-09-27 08:55:35 +02:00
project_settings.rs Make direct direnv loading default (#18536) 2024-09-30 15:35:36 +02:00
project_tests.rs lsp: Do not notify all language servers on file save (#17756) 2024-09-26 13:18:50 +02:00
search.rs Remove old project search code path, bump min-supported zed version for collaboration (#18404) 2024-09-26 12:10:39 -07:00
search_history.rs project search: Persist search history across session (#9932) 2024-04-02 11:13:18 +02:00
task_inventory.rs Allow task context providers to access project env (#17964) 2024-09-17 21:49:12 +02:00
terminals.rs terminal: Fix blinking settings & blinking with custom shape (#18538) 2024-09-30 15:36:35 +02:00
worktree_store.rs SSH Remoting: Fix bugs in worktree syncing (#18406) 2024-09-26 12:03:57 -07:00
yarn.rs chore: Fix several style lints (#17488) 2024-09-06 11:58:39 +02:00