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

<CTRL_C> breaks lualine #122

Closed
0ihsan opened this issue Feb 27, 2021 · 11 comments
Closed

<CTRL_C> breaks lualine #122

0ihsan opened this issue Feb 27, 2021 · 11 comments

Comments

@0ihsan
Copy link

0ihsan commented Feb 27, 2021

This is not happening every time I hit CTRL_C but sometimes.

CTRL-C breaks lualine

The error is

E5108: Error executing lua Keyboard interrupt
@hoob3rt
Copy link
Contributor

hoob3rt commented Feb 27, 2021

Mmm, this looks like it's not an issue with lualine but with the lua nvim api. Can you confirm that CTRL_C also breaks other lua plugins?

@0ihsan 0ihsan changed the title <CTRL_C> brakes lualine <CTRL_C> breaks lualine Feb 27, 2021
@0ihsan
Copy link
Author

0ihsan commented Feb 27, 2021

I haven't tried and don't know how to. Maybe secretly but this one was obvious.
Should I create the issue on https://github.com/neovim/neovim?

@shadmansaleh
Copy link
Member

Can you provide more information of how to reproduce it ? It's proving to be really hard to reproduce . If we can find a easier way to reproduce it we can test it on other plugins ..

@0ihsan
Copy link
Author

0ihsan commented Feb 27, 2021

I don't know how to reproduce exactly but I collected some key points I realised this issue occurs.

1. ✅ No Problem

  1. Open nvim
  2. Press i or a
  3. Press CTRL-C
  4. Go to step 2

2. ✅ No Problem

  1. Open nvim
  2. Press i or a
  3. Type "hello"
  4. Press CTRL-C
  5. Go to step 2

3. ❌ Issue Occurs

  1. Open an empty python file nvim x.py
  2. Press i or a
  3. Press CTRL-C
  4. Press i or a one more time (sometimes more than twice)
  5. Press CTRL-C
  6. See the status line disappeared and error message printed.

So, I suspect that this is something to do with filetypes or Python specific. I tried other filetypes and saw they are affected too. Here the filetypes I tried

  • ❌ Python
  • ❌ C
  • ❌ C++
  • ❌ Rust

I also tested how many times should I go to insert mode and normal mode again to reproduce this issue.
(I counted [i+CTRL-C] as 1)

  • nvim x.cc: 5, 2, 3, 3, 4, 5, 2, 4, 7...

So, I couldn't see I pattern here.


See Also

@shadmansaleh
Copy link
Member

Thanks for the info. In your config I can see you are using separate function for relative paths . But
lualines filename component provides relative path too . You can do

lauline_c = {{'filename', full_path = true}},

You can checkout Component options for details :)

@0ihsan
Copy link
Author

0ihsan commented Feb 27, 2021

Thank you, but I also have the filename blocking mechanism for terminal buffers in that function.

@hoob3rt
Copy link
Contributor

hoob3rt commented Mar 2, 2021

I stand by my point that it's not a lualine issue nor is it your configuration issue. All we are doing in our filetype components is calling vim.fn.expand functions. My guess is that it's a neovim/vim bug. Go ahead and submit an issue but I think you need to find a real cause of this crash as I suspect they would blame us if you refer a plugin with your ticket.

@hoob3rt hoob3rt closed this as completed Mar 2, 2021
@shadmansaleh
Copy link
Member

I suspect they would blame us if you refer a plugin with your ticket.

Not true . The neovim guys are pretry cool . I had mentioned this issue on neovim gitter . This issue needs better way of reproduceing if the cause is ever to be found . After aton of attempts I was only able to make it happen twice . Also it just happens randomly . Trying aton of times the same thing and wating for a bug to affect is npt realistic to do . Also I was actualy gona ask @ihsanturk are you using current master of neovim? I'm using current master and this issue almost naver happens . If you're using an old version can you try current master maybe this has been partialy solved already :)

@0ihsan
Copy link
Author

0ihsan commented Mar 2, 2021

I am using v0.5.0-dev. I will try master.
Thanks.

@0ihsan
Copy link
Author

0ihsan commented Mar 9, 2021

I solved by mapping <C-C> -> <C-[> as a workaround.

@icholy
Copy link

icholy commented Jul 7, 2022

I'm using nightly builds and this happens about once every hour for me. I cannot find a way to reliably reproduce.

icholy added a commit to icholy/dotfiles that referenced this issue Jul 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants