kovidgoyal / kitty

Cross-platform, fast, feature-rich, GPU based terminal
https://sw.kovidgoyal.net/kitty/
GNU General Public License v3.0
24.41k stars 980 forks source link

fish integration: drop redundant OSC 133 markers in upcoming fish 3.8 #7316

Closed krobelus closed 6 months ago

krobelus commented 6 months ago

The upcoming fish 3.8 release will output OSC 133 sequences unconditionally 1.

I tested ctrl-shift-{g,x,z} bindings both without and with kitty's shell integration on top; everything seems to work.

Let's simplify kitty integration by removing the markers for the upcoming fish >= 3.8.

I have hopes that the native OSC 133 implementation address #7200 though I'm not sure if I could reproduce this bug (I only saw a similar bug when fish_handle_reflow was not enabled, which fish also does now (same commit)). cc @iacore, let me know if you can reproduce #7200 with latest fish master.

kovidgoyal commented 6 months ago

Cool, that's great news. One question, the bug we recently collaborated on, mouse clicks to move the cursor #7168, this requires prompt marking to include the special_key=1 field, so that kitty knows to use a special key instead of the arrow keys for clicks. Is that included in the fish builtin prompt mark?

EDIT: Looking at the linked fish commit, it does not. https://github.com/fish-shell/fish-shell/commit/3b9e3e251bf9d4c7d0b31275cac55df68fe0127a#diff-74659ea3e6d931d656bc58a408a09b8b548e4e29a04ecb3c6a06163f18677a3bR839

krobelus commented 6 months ago

My bad, I'll push a fix. I also need to fix some other things with fish's CSI u parsing for this to work. My preliminary testing shows that the forward-char-passive approach has noticeable delay, at least with fish in debug mode. If that's not just a bug in fish we should probably use commandline --cursor 123 to set the cursor position directly (the argument is a 1-based code point index from the start of the command line). I'll look into it because it also needs a new feature to work with the search field..

krobelus commented 6 months ago

I've pushed the functional fixes to fish (866585c~3..866585c).

I haven't found a source of slowness in fish yet, still looking. I'm trying to run kitty/launcher/kitty --debug-input but that doesn't include a timestamp for the mouse click. A relative timestamp would be enough, I think I'll add relative timestamps to fish logs.


Also whenever I type kitty <TAB> in fish I get an error

Error: Invalid shell state specification: fish2

I don't know where fish2 is coming from. I'm using 0.33, probably same on master. cc @pagedown

krobelus commented 6 months ago

Ok I figured out the source of "slowness" - it's the double click interval (wayland here). Seems to be somewhere below 500ms here. So this is fine.

krobelus commented 6 months ago

found the completion issue as well, I had a stale kitty.fish from a old make install of fish.. I wish I didn't need to install, it'd be much better to provide a relocatable binary :(

kovidgoyal commented 6 months ago

merged, changing the code to only run bind --function-names once

iacore commented 6 months ago

cc @iacore, let me know if you can reproduce #7200 with latest fish master.

The problem is solved.

There is another weird thing that doesn't affect usability. When I start fish shell and not run anything, when I press Ctrl+Shift+G, the following text is shown in pager:

Welcome to fish, the friendly interactive shell
Type help for instructions on how to use fish

This is not the output of a command, but the welcome prompt. Maybe this is undesired in some circumstances?

kovidgoyal commented 6 months ago

On Thu, Apr 11, 2024 at 03:52:39AM -0700, iacore wrote:

cc @iacore, let me know if you can reproduce #7200 with latest fish master.

The problem is solved. There is another weird thing though.

When I start fish shell and not run anything, when I press Ctrl+Shift+G, the following text is shown in pager:

Welcome to fish, the friendly interactive shell
Type help for instructions on how to use fish

This is not the output of a command, but the welcome prompt.

It's not part of the prompt. Think of it as the output of a special welcome command fish runs at startup.

krobelus commented 6 months ago

Yeah I think that's a feature, not a bug. I expect that it's the same for motd (which can be somewhat long)