Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@auvred
Copy link
Contributor

@auvred auvred commented Sep 5, 2023

I've noticed that after closing the input prompt from the insert mode, the cursor shape doesn't change back to block

How to reproduce:

  1. open input prompt (e.g try to rename some file)
  2. press enter to close it (from insert mode)
  3. see that cursor shape is now bar (I guess it should be block as before opening yazi)
Before
yazi-before.mp4
After
yazi-after.mp4

(Not sure that I placed Term::set_cursor_block() to the right place)

@sxyazi
Copy link
Owner

sxyazi commented Sep 5, 2023

Thank you for your PR and detailed explanation!

It seems that for users whose default cursor is not a block, set_cursor_block doesn't make sense.

I think it's best to change set_cursor_block to set_cursor_default and use SetCursorStyle::DefaultUserShape instead of SetCursorStyle::BlinkingBlock here.

@auvred
Copy link
Contributor Author

auvred commented Sep 5, 2023

You're right! It makes more sense, I updated it

@sxyazi
Copy link
Owner

sxyazi commented Sep 5, 2023

There seems one missed

_ => Term::set_cursor_block(),

@auvred
Copy link
Contributor Author

auvred commented Sep 5, 2023

Okay I'll update this one too, but I'm not sure that we should show default shape in normal mode, if user's default shape is bar, then this might be confusing (same shape in both normal and insert modes)?

@sxyazi
Copy link
Owner

sxyazi commented Sep 5, 2023

Oh! I didn't think of that...

Keeping it as a block in normal mode should make sense, and it should restore to the default upon exiting.

@sxyazi
Copy link
Owner

sxyazi commented Sep 6, 2023

Thank you, merged!

@sxyazi sxyazi merged commit ac58f70 into sxyazi:main Sep 6, 2023
@adrian5
Copy link

adrian5 commented Sep 24, 2023

I think this issue persists when confirming There are … tasks running, sure to quit? (y/N) to exit the program. I didn't look at the code, but maybe that code path avoids the fix.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants