mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 19:38:12 +00:00
LibLine: Handle interrupts again
This commit makes LibLine handle interrupts (as reported via interrupted() and resized()) again. There is a little catch with the shell: ``` $ ls | pipe> <C-c> (prompt stays here until a key is pressed) ```
This commit is contained in:
parent
29029568ee
commit
889a8e7d0f
3 changed files with 31 additions and 15 deletions
|
@ -114,10 +114,16 @@ public:
|
|||
// since we can not do this cleanly ourselves. (signal() limitation: cannot give member functions)
|
||||
void interrupted()
|
||||
{
|
||||
if (m_is_editing)
|
||||
if (m_is_editing) {
|
||||
m_was_interrupted = true;
|
||||
handle_interrupt_event();
|
||||
}
|
||||
}
|
||||
void resized()
|
||||
{
|
||||
m_was_resized = true;
|
||||
refresh_display();
|
||||
}
|
||||
void resized() { m_was_resized = true; }
|
||||
|
||||
size_t cursor() const { return m_cursor; }
|
||||
const Vector<u32, 1024>& buffer() const { return m_buffer; }
|
||||
|
@ -176,6 +182,7 @@ private:
|
|||
Function<bool(Editor&)> callback;
|
||||
};
|
||||
|
||||
void handle_interrupt_event();
|
||||
void handle_read_event();
|
||||
|
||||
Vector<size_t, 2> vt_dsr();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue