nvim-telescope/telescope.nvim

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

FourteenBrush opened this issue · 5 comments

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()]]

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.

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

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

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

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