Coder Social home page Coder Social logo

Comments (8)

kovidgoyal avatar kovidgoyal commented on May 29, 2024

Doesnt reproduce for me with fish version 3.7.0 and empty fish config, and I dont see how
prompt marking can possibly affect completion. Probably some interaction
with something else in your fish config, bisect it to find out.

from kitty.

martonperei avatar martonperei commented on May 29, 2024

I've tested with no fish config, thats’s why I included the shell command with -N
It doesn't happen in iTerm2 with shell integration enabled.

Simplified the reproduction:

  1. kitty --config NONE /opt/homebrew/bin/fish -N --login --interactive
  2. Run printf "\033]133;A\007"; printf "\033]133;B\007"
  3. Type g -> g++ will be shown as a completion
  4. Click the mouse in the window (you don't need to, but it seems to trigger it. I've tested with the trackpad too)
  5. The completion will be triggered, but randomly the cursor goes back to before the first character. (and the completion isn't triggered)

It kinda looks like an issue with selection and/or focus.
It does not seem to reproduce with -o clear_all_mouse_actions=yes. Any ideas what mouse mappings in kitty could cause it? I disabled all apps that could interfere with input.

Thanks for any pointers!

from kitty.

kovidgoyal avatar kovidgoyal commented on May 29, 2024

clicking the mouse will send fake arrow key press events to move the
cursor. These will trigger completion depending on how you have
completion setup. IIRC in fish the right arrow completes. There isnt
anything that can be done to avoid this, as far as I know.

from kitty.

martonperei avatar martonperei commented on May 29, 2024

Hm, that makes sense. The cursor doesn't move on click without prompt marks, interesting, so that explains why it only happens with them.

Also, my best guess, that something in my setup must be sending phantom mouse presses to the kitty window periodically then, that's why it sometimes autocompletes without mouse presses.

Thanks a lot for the fast response!

from kitty.

kovidgoyal avatar kovidgoyal commented on May 29, 2024

Ideally, fish would have some input function that moves the cursor right
without accepting an auto-suggestion. Then the kitty fish shell integration
could bind that function to some otherwise unused escape sequence and we
would not have this issue. However, there is no such function:
https://fishshell.com/docs/current/cmds/bind.html that I can see.

Even more ideally, fish would add a function that has semantics of
"move cursor to the cell number X on line number Y, where Y is counted
from the line that starts the prompt".

You can try requesting something along these lines, maybe the fish
developers will be kind enough to provide such a function.

from kitty.

martonperei avatar martonperei commented on May 29, 2024

As a band-aid, I've disabled the left click prompt event, while keeping the prompt marks working (which is what I needed)
Kitty could send commandline -f suppress-autosuggestion before moving the cursor, but that would mean the completion would vanish. Though I think that's a little bit better behavior than the current one.
However, after some more debugging, this behavior exists in iTerm2 too, but you have to press alt to move the mouse.

from kitty.

martonperei avatar martonperei commented on May 29, 2024

Actually, there is commandline -C <cursor_position> which sets the cursor position in the current buffer without accepting the suggestion.

from kitty.

kovidgoyal avatar kovidgoyal commented on May 29, 2024

from kitty.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.