mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 10:48:11 +00:00
LibLine: Move the cursor to the beginning of the final line after ^C
We previously left it at the end of the final line, which caused the next prompt to start offset to the right: |$ foo^C | $ This commit makes LibLine move to the beginning of that line, making it so the next prompt shows up at the beginning of the line: |$ foo^C |$
This commit is contained in:
parent
fde174645a
commit
24a7df9b09
1 changed files with 2 additions and 1 deletions
|
@ -622,6 +622,7 @@ ErrorOr<void> Editor::interrupted()
|
|||
TRY(reposition_cursor(*stderr_stream, true));
|
||||
if (TRY(m_suggestion_display->cleanup()))
|
||||
TRY(reposition_cursor(*stderr_stream, true));
|
||||
TRY(stderr_stream->write_until_depleted("\r"sv.bytes()));
|
||||
}
|
||||
m_buffer.clear();
|
||||
m_chars_touched_in_the_middle = buffer().size();
|
||||
|
@ -816,7 +817,7 @@ void Editor::handle_interrupt_event()
|
|||
|
||||
m_previous_interrupt_was_handled_as_interrupt = true;
|
||||
|
||||
fprintf(stderr, "^C\r\n");
|
||||
fprintf(stderr, "^C\n");
|
||||
fflush(stderr);
|
||||
|
||||
if (on_interrupt_handled)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue