mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-08-04 14:46:03 +00:00
Clean previous PR
Some checks are pending
CI / Linux (python=3.13 cc=clang sanitize=1) (push) Waiting to run
CI / Linux (python=3.11 cc=gcc sanitize=0) (push) Waiting to run
CI / Linux (python=3.12 cc=gcc sanitize=1) (push) Waiting to run
CI / Linux package (push) Waiting to run
CI / Bundle test (macos-latest) (push) Waiting to run
CI / Bundle test (ubuntu-latest) (push) Waiting to run
CI / macOS Brew (push) Waiting to run
CI / Test ./dev.sh and benchmark (push) Waiting to run
CodeQL / CodeQL-Build (actions, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (c, macos-latest) (push) Waiting to run
CodeQL / CodeQL-Build (c, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (go, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (python, ubuntu-latest) (push) Waiting to run
Depscan / Scan dependencies for vulnerabilities (push) Waiting to run
Some checks are pending
CI / Linux (python=3.13 cc=clang sanitize=1) (push) Waiting to run
CI / Linux (python=3.11 cc=gcc sanitize=0) (push) Waiting to run
CI / Linux (python=3.12 cc=gcc sanitize=1) (push) Waiting to run
CI / Linux package (push) Waiting to run
CI / Bundle test (macos-latest) (push) Waiting to run
CI / Bundle test (ubuntu-latest) (push) Waiting to run
CI / macOS Brew (push) Waiting to run
CI / Test ./dev.sh and benchmark (push) Waiting to run
CodeQL / CodeQL-Build (actions, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (c, macos-latest) (push) Waiting to run
CodeQL / CodeQL-Build (c, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (go, ubuntu-latest) (push) Waiting to run
CodeQL / CodeQL-Build (python, ubuntu-latest) (push) Waiting to run
Depscan / Scan dependencies for vulnerabilities (push) Waiting to run
This commit is contained in:
parent
4e0f7faef8
commit
9cd2c60064
4 changed files with 12 additions and 10 deletions
|
|
@ -196,6 +196,8 @@ Detailed list of changes
|
|||
|
||||
- ``edit-in-kitty``: Return exit code from underlying editor process on exit (:iss:`10198`)
|
||||
|
||||
- Make erasing last command robust against commands with no output and commands in the scrollback (:pull:`10201`)
|
||||
|
||||
|
||||
0.47.4 [2026-06-15]
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
|
|
|||
|
|
@ -1261,7 +1261,7 @@ class Screen:
|
|||
def test_commit_write_buffer(self, inp: memoryview, output: memoryview) -> int: ...
|
||||
def test_parse_written_data(self, dump_callback: None = None) -> None: ...
|
||||
def hyperlink_for_id(self, hyperlink_id: int) -> str: ...
|
||||
def erase_last_command(self, include_prompt: bool = True) -> bool: ...
|
||||
def erase_last_command(self) -> bool: ...
|
||||
def set_progress(self, state: int, percent: int) -> None: ...
|
||||
def mark_potential_url_drag(self) -> bool: ...
|
||||
|
||||
|
|
|
|||
|
|
@ -4599,10 +4599,7 @@ find_cmd_output(Screen *self, OutputOffset *oo, index_type start_screen_y, unsig
|
|||
}
|
||||
|
||||
static PyObject*
|
||||
erase_last_command(Screen *self, PyObject *args) {
|
||||
int include_prompt = 1; // retained for API compatibility; the prompt block is the unit erased
|
||||
if (!PyArg_ParseTuple(args, "|p", &include_prompt)) return NULL;
|
||||
(void)include_prompt;
|
||||
erase_last_command(Screen *self, PyObject *args UNUSED) {
|
||||
if (self->linebuf != self->main_linebuf) Py_RETURN_FALSE;
|
||||
Line *line;
|
||||
// Erase the most recent command: the prompt block immediately above the
|
||||
|
|
@ -6244,7 +6241,7 @@ static PyMethodDef methods[] = {
|
|||
MND(draw, METH_O)
|
||||
MND(apply_sgr, METH_O)
|
||||
MND(cursor_position, METH_VARARGS)
|
||||
MND(erase_last_command, METH_VARARGS)
|
||||
MND(erase_last_command, METH_NOARGS)
|
||||
MND(set_window_char, METH_VARARGS)
|
||||
MND(set_progress, METH_VARARGS)
|
||||
MND(set_mode, METH_VARARGS)
|
||||
|
|
|
|||
|
|
@ -1627,7 +1627,7 @@ class TestScreen(BaseTest):
|
|||
s.draw('before\r\n')
|
||||
draw_prompt('p1'), draw_output(2), mark_prompt(), s.draw('partial')
|
||||
x = s.cursor.x
|
||||
s.erase_last_command(False) # include_prompt is now a no-op: the prompt block is the unit erased
|
||||
s.erase_last_command()
|
||||
self.ae('before\npartial', at().rstrip())
|
||||
for scroll in (8, 9, 10):
|
||||
s.reset()
|
||||
|
|
@ -1655,9 +1655,12 @@ class TestScreen(BaseTest):
|
|||
s.reset()
|
||||
s.draw('before\r\n')
|
||||
draw_prompt('p1'), draw_output(1), draw_prompt('e1'), draw_prompt('e2'), mark_prompt(), s.draw('partial')
|
||||
s.erase_last_command(); self.ae('before\n$ p1\n0\n$ e1\npartial', at().rstrip())
|
||||
s.erase_last_command(); self.ae('before\n$ p1\n0\npartial', at().rstrip())
|
||||
s.erase_last_command(); self.ae('before\npartial', at().rstrip())
|
||||
s.erase_last_command()
|
||||
self.ae('before\n$ p1\n0\n$ e1\npartial', at().rstrip())
|
||||
s.erase_last_command()
|
||||
self.ae('before\n$ p1\n0\npartial', at().rstrip())
|
||||
s.erase_last_command()
|
||||
self.ae('before\npartial', at().rstrip())
|
||||
# multi-line live prompt: the command region is erased with no residual
|
||||
s.reset()
|
||||
s.draw('before\r\n')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue