-
Notifications
You must be signed in to change notification settings - Fork 154
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
Restore the cursor shape when reedline exits #574
Conversation
Nice @nibon7, people have been asking for this. One question, does Update: Answering my own question here. It looks like it sets it to blinking block.
I'm wondering if this does what we want it to do, which is restore the users cursor to whatever it was prior to using reedline/nushell. Ansi escape values for cursor.
|
This makes it sound like restoring the cursor to whatever it was originally isn't possible across all platforms crossterm-rs/crossterm#646 |
Maybe. I tested on windows and linux, and it seems ok.
windows_block.mp4
windows_underscore.mp4
linux_block.mp4
linux_underscore.mp4 |
I'm fine with moving ahead with it, even though it doesn't seem like it would work. Your examples seem to prove otherwise. |
6c85aa0
to
1db0d10
Compare
Thanks! |
is there a way to disable this behavior? |
Not yet/(not sure if nushell will unset the cursor_shape option when none is given in the config)
Based on the settings on Windows terminal or inside nushell? |
i set my cursor to block in windows terminal. |
In the config we have the option here to allow you to disambiguate between the vi modes |
That worked for me. |
# Description This PR restores cursor shape when nushell exists. Fixes #9243 Related [nushell/reedline#574](nushell/reedline#574) # User-Facing Changes <!-- List of all changes that impact the user experience here. This helps us keep track of breaking changes. --> * windows https://github.com/nushell/nushell/assets/15247421/ede8d1c0-ecd1-40b0-87b0-6393c1a7160f * linux https://github.com/nushell/nushell/assets/15247421/b428f17e-05cb-45ad-aa5f-3a9753fd9176 * macos https://github.com/nushell/nushell/assets/15247421/5170dabd-8b9f-4bad-a7a2-bdabfca45cca # 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 -A clippy::result_large_err` 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. -->
For reference, this seems to work on Apple Terminal on macOS 13.5.1 (block): Screen.Recording.2023-09-07.at.09.50.09.mov |
Restore the cursor shape when reedline exits.
Tested on Linux (Alacritty 0.13.0) and Windows terminal.