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

Bug: Cursor disappears when opening fzf-lua #1827

Closed
2 of 6 tasks
MariaSolOs opened this issue Feb 13, 2025 · 16 comments
Closed
2 of 6 tasks

Bug: Cursor disappears when opening fzf-lua #1827

MariaSolOs opened this issue Feb 13, 2025 · 16 comments
Labels
upstream An issue upstream (neovim, fzf, etc)

Comments

@MariaSolOs
Copy link
Contributor

RTFM Checklist

  • I have searched exisiting issues / discussions
  • I have read the Wiki including the Advanced section
  • I have read man fzf / I am well versed in shell fzf

Operating system

Mac

Shell

fish

Neovim version (nvim --version)

v0.11.0-dev-1734+gac768996b2

Fzf version (fzf --version)

0.59.0

Output of :lua print(os.getenv('FZF_DEFAULT_OPTS'))

--color=fg:#f8f8f2,bg:#0e1419,hl:#e11299,fg+:#f8f8f2,bg+:#44475a,hl+:#e11299,info:#f1fa8c,prompt:#50fa7b,pointer:#ff79c6,marker:#ff79c6,spinner:#a4ffff,header:#6272a4 --cycle

Is the problem reproducible with mini.sh?

  • My issue is reproducible with mini.sh
  • My issue IS NOT reproducible with mini.sh
  • I have not tested with mini.sh (not relevant, requires LSP, Windows, etc)

Fzf-lua configuration

require('fzf-lua').setup({
  fzf_colors = {
    bg = { 'bg', 'Normal' },
    gutter = { 'bg', 'Normal' },
    info = { 'fg', 'Conditional' },
    scrollbar = { 'bg', 'Normal' },
    separator = { 'fg', 'Comment' },
  },
  fzf_opts = {
    ['--info'] = 'default',
    ['--layout'] = 'reverse-list',
  },
  keymap = {
    builtin = {
      ['<C-/>'] = 'toggle-help',
      ['<C-a>'] = 'toggle-fullscreen',
      ['<C-i>'] = 'toggle-preview',
      ['<C-f>'] = 'preview-page-down',
      ['<C-b>'] = 'preview-page-up',
    },
    fzf = {
      ['alt-s'] = 'toggle',
      ['alt-a'] = 'toggle-all',
    },
  },
  winopts = {
    height = 0.7,
    width = 0.55,
    preview = {
      scrollbar = false,
      layout = 'vertical',
      vertical = 'up:40%',
    },
  },
  defaults = { git_icons = false },
  files = {
    winopts = {
      preview = { hidden = true },
    },
  },
  grep = {
    header_prefix = icons.misc.search .. ' ',
  },
  helptags = {
    actions = {
      -- Open help pages in a vertical split.
      ['enter'] = actions.help_vert,
    },
  },
  lsp = {
    symbols = {
        symbol_icons = icons.symbol_kinds,
    },
  },
  oldfiles = {
    include_current_session = true,
    winopts = {
      preview = { hidden = true },
    },
  },
})

Describe the bug / steps to reproduce

I'm sorry for the lack of details on this one, but I don't know how to debug it further. Please let me know if there are logs or anything else I can provide to ease the investigation.

For some strange reason the cursor often (I would say around 20%-40% of the time) disappears after opening fzf-lua, forcing me to re-open Neovim for the cursor to be visible again. I think this has to do with the recent changes (like neovim/neovim#31562) in core around terminal cursors.

@MariaSolOs MariaSolOs added the bug Something isn't working label Feb 13, 2025
@ibhagwan
Copy link
Owner

Does this happen only on nightly?

When you say disappears, does it simply vanish? If there’s no way to restore it other than neovim restart this sounds like an upstream issue, I’ll try to reproduce and see if there’s a workaround we can apply from fzf-lua’s side.

@ibhagwan
Copy link
Owner

If you can find a more consistent reproduce than 20-40% of the time would be great, also interested to know if this happens when opening :new | term regardless of fzf-lua.

This does smell upstream relating to the changes you linked.

@MariaSolOs
Copy link
Contributor Author

@ibhagwan it does happen only on nightly. And by disappear I mean that I can't see the cursor at all, yet I can still move it (I notice that based on the relative line numbers in the sign column changing).

@MariaSolOs
Copy link
Contributor Author

cc @seandewar since you're also see this happen and you might be able to give better repro details.

@MariaSolOs
Copy link
Contributor Author

I don't know if it's relevant but I use ghostty btw.

@ibhagwan
Copy link
Owner

@MariaSolOs, @gpanders neovim/neovim#31562 (comment)

I was able to solve the cursor issue so this is fully working now. I also implemented cursor hiding, so if an application in the terminal emulator hides the cursor it will be hidden in Nvim too.

Could this be related?

@ibhagwan
Copy link
Owner

@MariaSolOs, can you post the output of :set guicursor? before and after disappearance?

@MariaSolOs
Copy link
Contributor Author

@MariaSolOs, can you post the output of :set guicursor? before and after disappearance?

Before: n-v-c-sm:block,i-ci-ve:ver25,r-cr-o:hor20,t:block-TermCursor
After: Will edit this later once it happens again

@ibhagwan
Copy link
Owner

@MariaSolOs, once the cursor disappears can you run :!tput cnorm and see if that restores the cursor?

@phanen
Copy link
Contributor

phanen commented Feb 15, 2025

Reproduce this in kitty.
n-v-c-sm:block,i-c-ci-ve-t:ver25,r-cr-o:hor20 (didn't change before/after cursor missing)

  • :!tput cnorm didn't restore cursor.
  • redraw, nvim__redraw, didn't restore cursor.

The only workaround without restarting I found is attaching a new client: nvim --remote-ui (then :detach previous client if use nightly)

@ibhagwan
Copy link
Owner

Reproduce this in kitty. n-v-c-sm:block,i-c-ci-ve-t:ver25,r-cr-o:hor20 (didn't change before/after cursor missing)

  • :!tput cnorm didn't restore cursor.
  • redraw, nvim__redraw, didn't restore cursor.

The only workaround without restarting I found is attaching a new client: nvim --remote-ui (then :detach previous client if use nightly)

This is more likely than not an upstream issue, fzf-lua does nothing that should hide the cursor to this effect.

@seandewar
Copy link

This looks like an issue in Nvim since the terminal cursor changes; I've filed an issue at neovim/neovim#32456.

@ibhagwan ibhagwan removed the bug Something isn't working label Feb 15, 2025
@MariaSolOs
Copy link
Contributor Author

Thank you @seandewar for the investigation and repro steps! <3

@ibhagwan feel free to close this as it's indeed an editor issue, I don't want to clutter your issue tracker.

@ibhagwan
Copy link
Owner

Thank you @seandewar for the investigation and repro steps! <3

@ibhagwan feel free to close this as it's indeed an editor issue, I don't want to clutter your issue tracker.

Ty @seandewar.

@MariaSolOs, we can keep this for tracking until neovim/neovim#32458 is merged.

@seandewar
Copy link

FYI I've merged it now, so the issue should be fixed. 🙏

@ibhagwan
Copy link
Owner

FYI I've merged it now, so the issue should be fixed. 🙏

Tysm @seandewar!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream An issue upstream (neovim, fzf, etc)
Projects
None yet
Development

No branches or pull requests

4 participants