diff --git a/src/apps/terminal/BasicTerminalBuffer.cpp b/src/apps/terminal/BasicTerminalBuffer.cpp index 6470031c02..41f85fad39 100644 --- a/src/apps/terminal/BasicTerminalBuffer.cpp +++ b/src/apps/terminal/BasicTerminalBuffer.cpp @@ -1352,7 +1352,7 @@ BasicTerminalBuffer::_InsertGap(int32 width) line->cells + fCursor.x, toMove * sizeof(TerminalCell)); } - line->length += width; + line->length = min_c(line->length + width, fWidth); }