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
Cursor style is overridden when exiting nushell #8452
Comments
You can change your cursor shape in the config file like this
Also, if your terminal supports xterm sequences you can follow these rules, outside of nushell, to reset your cursor shape.
So, for a steady block you'd type
|
Is it possible to change the default cursor to block? |
I don't understand @aetherplex, I explained how to change it in the comment above yours. Am I misunderstanding your question? |
I think what you've suggested for changing the cursor is perfectly valid, however I think I'd prefer to understand why it's changing the terminal cursor when I'm not in a Surely any changes that are made inside the session should be reverted when exited? |
@scallaway, my question was directed at @aetherplex. Regarding your question about after nushell, maybe you're right. I'm not sure. Cursors are usually controlled by the terminal or the prompt. We're a few versions behind on our crossterm crate, which controls this. I'm not sure if there is a change in it or not. We also could have a bug in reedline or nushell that is causing this. It'll take a dedicated soul to try and figure that out. It seems like your terminal is taking a passive approach, meaning that whomever changes the cursor, it will just use that. You could try the echo statement I have above to change it however you see fit. Currently, I think nushell takes the opposite approach, which is to set the cursor no matter what you change it to in the terminal and the only way to change it is to change it in the config. |
I encounter the same issue. If I remember correctly, it is considered good practice for any terminal program to store the state of terminal when it starts and restore that state it as it was before when it exits. |
It can work either way but I get your point. We'd probably accept a PR to reedline and/or nushell to help with this. |
I have something similar which may or may not have the same cause: I'm playing around with nushell, trying it out, changing some config options, launching it and exiting it again. This is all from Fish shell. In Fish my cursor is a solid block, in nushell I configured it to be a solid block as well but: When I exit nushell to Fish my cursor is a blinking solid block so I run it like this now to reset it to a non-blinking solid block I do not have this issue with any other programs I launch from Fish, including my own shell I'm developing. |
Seems crossterm has now a function to get cursor shape so nushell could use that to restore the cursor before exit? |
I don't see the function. Is it in crossterm or just in someone's fork? |
# Description There are several cursor shape related issues #7151 #9243 #7271 #8452 #10169, you can't disable the cursor shape feature even if you comment out the entire `cursor_shape` block in the config.nu, and even worse, when nushell exits with an error, the cursor shape can't be restored, that is annoying. This PR provides an opportunity to disable setting the cursor shape. # User-Facing Changes If you use the default config.nu, nothing changes, but if you comment out `cursor_shape` block or set them to `inherit`, related cursor shape will not be set. # 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` to check that you're using the standard code style - `cargo test --workspace` to check that all tests pass (on Windows make sure to [enable developer mode](https://learn.microsoft.com/en-us/windows/apps/get-started/developer-mode-features-and-debugging)) - `cargo run -- -c "use std testing; testing run-tests --path crates/nu-std"` 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. -->
closing since #10289 landed. let's open a new issue if there are still problems. |
Describe the bug
For all my terminals, I have the cursor set to the block-style at all times.
When I enter nushell, the default is to have the cursor in line-style.
However, when I exit nushell, the terminal continues to use the line-style for the cursor in the current session.
I have confirmed this is both the case with Kitty terminal on linux and Windows terminal (with WSL) on Windows 11.
How to reproduce
This is easiest to see when you have a
tmux
instance open (so you can compare).It's worth noting at this point that if you open another tmux session, then the cursor style is as you originally configured (block-style in my case).
Expected behavior
I'd expect the cursor style to not be overridden once you've exited a nushell session.
Screenshots
Configuration
Additional context
No response
The text was updated successfully, but these errors were encountered: