Fix the problem caused by wrong cursor coordinates. No more messing with
the main cursor, instead the cursor is saved when receiving a pre-edit
text update and used for drawing later.
Update the overlay to the last visible cursor position before rendering
to ensure it always moves with the cursor. Finally, draw the overlay
after line rendering is complete, and restore the line buffer after
updating the rendered data to ensure that the line text being read is
correct at all times.
This also improves performance by only rendering once when changes are
made, eliminating the need to repeatedly disable and draw after various
commands and not even comprehensively.
Correctly update the overlay position when cursor visibility changes.
Restore the overlay line only when the cursor is visible.
Clear the saved overlay when drawing new pre-edit text.
Also update the cursor position when screen size changes.
Use four spaces to indent instead of two.
Fixing this involved adding a new mode to kitty where it handles
ctrl-c/z/q by sending signals to the tty foreground process group
instead of delegating to the kernel to do that. Since the pipe may be
full we have no way of knowing when the kernel will get around to
reading the signal byte. So send the signal ourselves.
Fixes#5271
Can be used with shell integration to give more accurate
cwd detection and also combined with the ssh kitten
to magically open new windows connected to remote servers
at the correct cwd on the remote server instantly.
Since we are only sending the last command, it cannot have CSI
sequences in it anyway except in extremely contrived situations, so just
strip all ctrl chars out.
Also clean up handling of dynamic global colors.
TODO: Implement none for selection_fg
TODO: Add some tests
TODO: Check that changing colors via remote control works
Fixes#126
Now a stack of depth 1 is used to save/restore private mode values. And
saving/restoring individual modes is supported. This latter is used by
midnight commander.
Right now visual bell makes background flash sharply with bright white
(when configured with darkish color theme). This causes eye strain,
especially prominent in unlit environments.
This change makes background bounce smoothly between regular bg color
and highlight (selection) bg color for the configured visual bell
duration. Intensity is animated with cubic easing functions. It
currently peaks at 20% of the duration, this is hardcoded.
Mark functions computing intensity and easing as inline
Do smarter blending of visual bell flash
Blend highlight color with pegtop's softlight mode over both background
and half as much over foreground. This should help with flash visibility
in light themed and inverted colors contexts.
Blend flash in BACKGROUND pass also
Revert "Do smarter blending of visual bell flash"
This reverts commit 9a269d55c7d04334b1c4891c42914423517dfad6.
Revert "Blend flash in BACKGROUND pass also"
This reverts commit 756332cb9d7576b08db78406e37349aa6d1df156.
Revert "Make visual bell flash much more gentle"
This reverts commit cbfe5d59ada2da690e14c7532a7468b0c307c462.
Render flash overlay in a separate drawcall
Trigger frequent repaints to make for smooth animation
Attenuate flash a bit more
A better solution from an ecosystem perspective is to just work with the
original protocol. I have modified kitty's escape parser to special case
OSC 52 handling without changing its max escape code size.
Basically, it works by splitting up OSC 52 escape codes longer than the
max size into a series of partial OSC 52 escape codes. These get
dispatched to the UI layer where it accumulates them upto the 8MB limit
and then sends to clipboard when the partial sequence ends.
See https://github.com/ranger/ranger/issues/1861
Should get much closer semantics in the two cases and its nice not to
have an extra mini VT parser for pending mode. There is a performance
hit in pending mode, since now the pending mode bytes are round tripped
via utf-8 decoding/encoding, but its worth it for the code
simplification.