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

[fish shell integration] repaint removes text printed by fish key binding #7200

Closed
iacore opened this issue Mar 6, 2024 · 2 comments
Closed
Labels

Comments

@iacore
Copy link

iacore commented Mar 6, 2024

Describe the bug
text printed by keybind in fish disappear when screen is repaint (such as resizing the window)

To Reproduce
Steps to reproduce the behavior:

  1. open new window with kitty --config NONE fish
  2. run bind \eg 'echo; git status; git remote -v; echo; commandline -f repaint'
  3. press Alt+g in a git repo
  4. resize the window to be wider or narrower (in width)

Screenshots

The screenshots below show the whole window width.

After git init, I pressed Alt+g, and git information is shown.

image

Then, I resize the kitty window to be wider, and the git info text is gone, leaving an empty space.

image

Environment details

❯ kitty --version
kitty 0.31.0 created by Kovid Goyal

❯ fish --version
fish, version 3.6.4

Additional context

Ctrl+Shift+G (show last command output in pager) ignores the output printed by fish keybind. I think this is the appropriate behavior.

Can reproduce with kitty --config NONE. Latest fish version (3.7.0) probably works too.

The issue is first discussed in fish-shell/fish-shell#10289.

@iacore iacore added the bug label Mar 6, 2024
@iacore iacore changed the title shell integrationaprompt shell integration, fish, repaint issue Mar 6, 2024
@iacore iacore changed the title shell integration, fish, repaint issue shell integration, fish, repaint removes text Mar 6, 2024
@iacore iacore changed the title shell integration, fish, repaint removes text repaint removes text printed by fish key binding Mar 6, 2024
@iacore
Copy link
Author

iacore commented Mar 6, 2024

I have "fixed" the problem by calling __ksi_mark_prompt_start at the end.

e.g. bind \eg 'echo; git status; git remote -v; echo; commandline -f repaint; __ksi_mark_prompt_start'

commandline -f repaint is recommended by fish documentation. I guess the fish_prompt event is not fired after commandline -f repaint.

@iacore iacore changed the title repaint removes text printed by fish key binding [fish shell integration] repaint removes text printed by fish key binding Mar 6, 2024
@kovidgoyal
Copy link
Owner

I dont know of anyway to fix this. If commandline -f repaint doesnt run
the prompt marking hooks, there is nothing the shell integration script
can do about it. Really, the correct fix for this is for fish to
implement prompt marking itself instead of every terminal emulator
having to write a script for it.

krobelus added a commit to krobelus/kitty that referenced this issue Apr 6, 2024
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 kovidgoyal#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 kovidgoyal#7200 with latest fish master.

[1]: fish-shell/fish-shell@3b9e3e2
Rhodate pushed a commit to Rhodate/kitty that referenced this issue Apr 13, 2024
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 kovidgoyal#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 kovidgoyal#7200 with latest fish master.

[1]: fish-shell/fish-shell@3b9e3e2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants