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

live_grep select_default on Kitty clears input field rather than jumping to match #3048

Open
FourteenBrush opened this issue Apr 13, 2024 · 5 comments
Labels
bug Something isn't working not reproducible

Comments

@FourteenBrush
Copy link

Description

When using the live_grep function of Telescope, most of the times (but not all times), when pressing enter, the input field gets cleared rather than jumping to the match.

Please note that this ONLY happens when using Kitty, all other terminal emulators that I've tested worked fine.

In the video attached below you can see that when grepping for "ODIN_DEBUG", pressing enter simply clears the input field, this seems to occur more frequently when having fzf installed (apt install fzf) (not sure if that's related), and grepping for longer words also seems to increase the frequency of it happening.

This works fine when holding alt and then pressing enter, similar to #2731.

Running :verbose imap <cr> while having the live grep window open tells me telescope|select_default is bound.

Neovim version

NVIM v0.10.0-dev-2494+g39928a7f2
Build type: RelWithDebInfo
LuaJIT 2.1.1707061634

Operating system and version

Pop!_OS 22.04 LTS

Telescope version / branch / rev

0.1.6 I assume / commit 5a701e9

checkhealth telescope

telescope: health#telescope#check

Checking for required plugins ~
- OK plenary installed.
- OK nvim-treesitter installed.

Checking external dependencies ~
- OK rg: found ripgrep 13.0.0
- OK fd: found fd 8.3.1

===== Installed extensions ===== ~

Steps to reproduce

  1. Use the minimal config below
  2. Open some directory with nvim
  3. Press gi, type something and press enter

Expected behavior

This should simply jump to the expected line rather than clearing the input field.

Actual behavior

Screencast.from.04-13-2024.12.14.37.PM.webm

The fact that I'm in a git repo is not important.

Minimal config

vim.g.mapleader = ' '

vim.cmd [[set runtimepath=$VIMRUNTIME]]
vim.cmd [[set packpath=/tmp/nvim/site]]
local package_root = '/tmp/nvim/site/pack'
local install_path = package_root .. '/packer/start/packer.nvim'
local function load_plugins()
  require('packer').startup {
    {
      'wbthomason/packer.nvim',
      {
        'nvim-telescope/telescope.nvim',
        requires = {
          'nvim-lua/plenary.nvim',
          { 'nvim-telescope/telescope-fzf-native.nvim', run = 'make' },
        },
      },
      -- ADD PLUGINS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
    },
    config = {
      package_root = package_root,
      compile_path = install_path .. '/plugin/packer_compiled.lua',
      display = { non_interactive = true },
    },
  }
end
_G.load_config = function()
  require('telescope').setup()
  require('telescope').load_extension('fzf')
  -- ADD INIT.LUA SETTINGS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE

  local keymap = vim.keymap
  keymap.set('n', '<Leader>ff', '<cmd>:Telescope find_files hidden=true<cr>')
  keymap.set('n', '<Leader>fi', '<cmd>:Telescope find_files hidden=true theme=ivy<cr>')
  keymap.set('n', '<Leader>fv', '<cmd>:Telescope find_files hidden=true layout_strategy=vertical<cr>')

  keymap.set('n', '<Leader>fg', '<cmd>:Telescope live_grep<cr>')
  keymap.set('n', '<Leader>gi', '<cmd>:Telescope live_grep theme=ivy<cr>')
  keymap.set('n', '<Leader>gv', '<cmd>:Telescope live_grep layout_strategy=vertical<cr>')

end
if vim.fn.isdirectory(install_path) == 0 then
  print("Installing Telescope and dependencies.")
  vim.fn.system { 'git', 'clone', '--depth=1', 'https://github.com/wbthomason/packer.nvim', install_path }
end
load_plugins()
require('packer').sync()
vim.cmd [[autocmd User PackerComplete ++once echo "Ready!" | lua load_config()]]
@FourteenBrush FourteenBrush added the bug Something isn't working label Apr 13, 2024
@jamestrew
Copy link
Contributor

hmm...
I don't really know how to help you with this. I'm also using kitty and have fzf installed but I haven't experienced this before.
If it only happens on kitty, seems like it's a kitty config issue.

@FourteenBrush
Copy link
Author

Same issue with a default kitty config, I have no idea what this might be related to..

@jamestrew
Copy link
Contributor

Just spitballing here but you don't happen to have a custom keyboard, maybe the enter key is sending something not exactly enter? 😅 honestly no idea

@FourteenBrush
Copy link
Author

FourteenBrush commented Apr 14, 2024

I would assume not, simply got an azerty Lenovo laptop keyboard, here's the output of xev if you're interested 😄

KeyPress event, serial 37, synthetic NO, window 0x4200001,
    root 0x6ce, subw 0x0, time 41732960, (131,77), root:(2922,566),
    state 0x0, keycode 36 (keysym 0xff0d, Return), same_screen YES,
"   XLookupString gives 1 bytes: (0d) "
"   XmbLookupString gives 1 bytes: (0d) "
    XFilterEvent returns: False

@FourteenBrush
Copy link
Author

A bit late, but maybe it could help if i send my kitty config:
https://github.com/FourteenBrush/dotfiles/blob/main/kitty/kitty.conf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working not reproducible
Projects
None yet
Development

No branches or pull requests

2 participants