Skip to content

Commit a55ce3e

Browse files
committed
fix deletechars bug
1 parent e8190f6 commit a55ce3e

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

src/XTerm.NET/InputHandler.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -960,8 +960,16 @@ private void DeleteChars(Params parameters)
960960
{
961961
var count = Math.Max(parameters.GetParam(0, 1), 1);
962962
var line = _buffer.Lines[_buffer.Y + _buffer.YBase];
963-
line?.CopyCellsFrom(line, _buffer.X + count, _buffer.X,
963+
if (line == null)
964+
return;
965+
966+
line.CopyCellsFrom(line, _buffer.X + count, _buffer.X,
964967
_terminal.Cols - _buffer.X - count, false);
968+
969+
// Fill vacated cells at right edge with current attributes (BCE)
970+
var emptyCell = BufferCell.Space;
971+
emptyCell.Attributes = _curAttr;
972+
line.Fill(emptyCell, _terminal.Cols - count, _terminal.Cols);
965973
}
966974

967975
private void EraseChars(Params parameters)

0 commit comments

Comments
 (0)