erase_last_command selected the region to erase via find_cmd_output(..., -1),
which anchors on OUTPUT_START (OSC, 133;C). Commands that produce no output
(an empty Enter, a comment, cd, export, etc. -- never emit 133;C, so they were
skipped and an older command-with-output was erased instead. "Erase the last
command" therefore did not erase the last command whenever the most recent ones
has no output.
Select the region by prompt marks instead: erase the prompt block immediately
above the current (live) prompt, whatever it contains. Every submittd command
is now one unit, removed newest-first, one prompt block per invocation.
This also fixes two latent defects in the previous implementation:
* The on-screen deletion was anchored at `cursor->y - count`, which
assumes the region ends exactly one row above the cursor.
Multi-line prompts and skipped rows broke that assumption and left
residual lines. Anchor at the top of the region instead.
* When part of the erased region was in the scrollback, the lines
were removed from the history buffer but no redraw was signalled,
so the deletion of the off-screen lines only became visible after
the next scroll event recomputed the history viewport. Clamp
scrolled_by to the new history length and call dirty_scroll()
after shrinking the buffer.
include_prompt is retained for API compatibility but is now a no-op: the
unit erased is always the whole prompt block.
- Python (kitty/launch.py): Track editor PID via monitor_pid to capture
exit code when editor window closes. Send exit code as data in the DONE
message instead of sending no data.
- Go (tools/cmd/edit_in_kitty/main.go): Parse exit code from DONE message
data and use lp.Quit(exit_code) to exit with the editor's exit code.
- Go (tools/cmd/tool/confirm_and_run_shebang.go): Check exit code when
running edit-in-kitty as a subprocess; abort execution on editor failure.
Allows using up to date simde and newer compilers for small performance
improvements. Ubuntu 18 and 20 are EOL and Ubuntu 22 was released over four
years ago.
This will also hopefully allow us to build slang for the upcoming
transition to slang based shaders.
Change the graphics protocol N key from a boolean into a usage-hints
bitmask. Define the first bit as a transient hint, allowing the terminal
to treat the image data as short-lived and apply optimizations such as
skipping disk cache writes.
Propagate the transient hint through frame coalescing and composition, so
a composed frame is transient if any contributing frame is transient.