Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to disable line cursor blinking? #8988

Closed
TomLebeda opened this issue Apr 25, 2023 · 9 comments · Fixed by #8990
Closed

How to disable line cursor blinking? #8988

TomLebeda opened this issue Apr 25, 2023 · 9 comments · Fixed by #8990
Labels
question the issue author asks something

Comments

@TomLebeda
Copy link

Question

Hello,

I have tried reading through documentation, issues here on GitHub as well as the config files, but I couldn't find anywhere where/how to disable the line cursor blinking? The block doesn't blink, so I assume it should be possible.

Thank you.

Additional context and details

No response

@TomLebeda TomLebeda added the question the issue author asks something label Apr 25, 2023
@hustcer
Copy link
Contributor

hustcer commented Apr 25, 2023

Duplicate of #6214?

@TomLebeda
Copy link
Author

I will check it out, but the #6214 seems like "flickering" is unintentional behaviour, that doesn't happen to me. What I mean is the slow blinking on/off when cursor is idle - that seems to me intentional.

@sophiajt
Copy link
Member

@TomLebeda it's possible there's an ansi sequence that does this, though I was also wondering if you could change it via your terminal settings.

@WindSoilder
Copy link
Collaborator

WindSoilder commented Apr 25, 2023

I think you can just change cursor_shape to underscore(in config file):

cursor_shape: {
    emacs: underscore # block, underscore, line (line is the default)
  }

@TomLebeda
Copy link
Author

@jntrnr I have blinking disabled in terminal itself (both wezterm and alacritty), but when I enter nushell, it overrides it (at when I exit nushell, it stays overriden and doesn't return back to original). Could you please elabore how/where should I add/remove the ansi sequence?

@TomLebeda
Copy link
Author

@WindSoilder Yeah, but I like the vertical line cursor, I am used to underscore being "replace" mode.

@fdncred
Copy link
Collaborator

fdncred commented Apr 25, 2023

I don't believe nushell makes cursors blink. That is a terminal thing. I've looked and don't see it anywhere. This explains all we do right now. #8452 (comment) and also shows the ansi escape sequences that could change your cursor.

However, if you have it set in your terminal, the ansi escape sequences probably won't make a difference. This makes your cursor a solid block echo "\e[2 q" but in WezTerm, I have it set to

default_cursor_style = "BlinkingBar", -- SteadyBlock, BlinkingBlock, SteadyUnderline, BlinkingUnderline, SteadyBar, and BlinkingBar

which overrides that escape.

@WindSoilder
Copy link
Collaborator

WindSoilder commented Apr 25, 2023

I found that in the latest main, using underscore with be a line cursor without blinking...

@TomLebeda
Copy link
Author

@fdncred Thank you, it worked! You were right, the blinking was done by wezterm. However, I was using block cursor in wezterm with plain bash, so it wasn't visible. When I explicitly disabled the blinking in wezterm, it stopped in nushell as well.

fdncred pushed a commit that referenced this issue Apr 26, 2023
# Description
Close: #8988

Thanks to new crossterm version, nushell can support blink cursor shape.
It can be config with the following value:
1. blink_block
2. blink_line
3. blink_underscore

And original block, line, underscore will be steady. It also fixes wrong
shape of `underscore`.

# User-Facing Changes
Here is a little breaking change, before the change: `line` cursor shape
is blinking line, but after this pr, it will be `steady line`. To make a
blink line, we need to change the value to `blink_line`.

But I think it's ok, because after the change, we have a good naming
convention about the name of shape

# Tests + Formatting
<!--
Don't forget to add tests that cover your changes.

Make sure you've run and fixed any issues with these commands:

- `cargo fmt --all -- --check` to check standard code formatting (`cargo
fmt --all` applies these changes)
- `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used -A
clippy::needless_collect` to check that you're using the standard code
style
- `cargo test --workspace` to check that all tests pass
- `cargo run -- crates/nu-std/tests/run.nu` to run the tests for the
standard library

> **Note**
> from `nushell` you can also use the `toolkit` as follows
> ```bash
> use toolkit.nu # or use an `env_change` hook to activate it
automatically
> toolkit check pr
> ```
-->

# After Submitting
<!-- If your PR had any user-facing changes, update [the
documentation](https://github.com/nushell/nushell.github.io) after the
PR is merged, if necessary. This will help us keep the docs up to date.
-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question the issue author asks something
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants