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

Vi mode cursor shape not updating on ctrl-c when in default mode #8125

Closed
SpikeTheMarmot opened this issue Jul 8, 2021 · 1 comment
Closed
Labels
bug Something that's not working as intended
Milestone

Comments

@SpikeTheMarmot
Copy link

SpikeTheMarmot commented Jul 8, 2021

$ fish --version
fish, version 3.3.1
$ echo $version
3.3.1
$ lsb_release -d
Description:	Arch Linux
$ uname -a
Linux marmot 5.12.14-arch1-1 #1 SMP PREEMPT Thu, 01 Jul 2021 07:26:06 +0000 x86_64 GNU/Linux
$ echo $TERM
xterm-kitty

Hey,
after further configuration of fish to my liking, I have discovered another bug with vi mode when using ctrl-c in default mode.
I use the following universal variables to change the appearance of the cursor in vi mode:

SETUVAR fish_cursor_default:block
SETUVAR fish_cursor_insert:line
SETUVAR fish_cursor_replace:underscore
SETUVAR fish_cursor_replace_one:underscore
SETUVAR fish_cursor_visual:block

If you are in normal/default mode and cancel the current input with ctrl-c the shell prints a new prompt in the next line as expected but does not update the cursor shape. If I then go to normal mode and back into insert mode the issue resolves itself.
Apart from that the different cursor shapes have been working well so far.

I am not quite sure what's causing this problem, as fish_vi_cursor_handle should be executed on change of fish_bind_mode and fish_bind_mode actually changes (otherwise the mode prompt would not update correctly). #8103 might be relevant.

@ridiculousfish
Copy link
Member

Nice find! This is more or less the same as #6937: we're not clearing the cancel flag from control-C, so the event handler to change the cursor shape isn't running. I'll have a fix shortly.

@zanchey zanchey added this to the fish 3.4.0 milestone Jul 12, 2021
thunder-coding pushed a commit to thunder-coding/fish-shell that referenced this issue Jul 13, 2021
When the user presses control-C, fish marks a cancellation signal which
prevents fish script from running, allowing it to properly unwind.
Prior to this commit, the signal was cleared in the reader. However this
missed the case where a binding would set $fish_bind_mode which would
trigger event handlers: the event handlers would be skipped because of
the cancellation flag was still set. This is similar to fish-shell#6937.

Let's clear the flag earlier, as soon as we it's set, in inputter_t.
Fixes fish-shell#8125.
@faho faho added the bug Something that's not working as intended label Jul 15, 2021
thunder-coding pushed a commit to thunder-coding/fish-shell that referenced this issue Jul 28, 2021
When the user presses control-C, fish marks a cancellation signal which
prevents fish script from running, allowing it to properly unwind.
Prior to this commit, the signal was cleared in the reader. However this
missed the case where a binding would set $fish_bind_mode which would
trigger event handlers: the event handlers would be skipped because of
the cancellation flag was still set. This is similar to fish-shell#6937.

Let's clear the flag earlier, as soon as we it's set, in inputter_t.
Fixes fish-shell#8125.
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something that's not working as intended
Projects
None yet
Development

No branches or pull requests

4 participants