Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1790,11 +1790,18 @@ private string ReadLineFromConsole(bool endOnTab, string initialContent, bool ca
continue;
}

// Handle case where terminal gets reset and the index is outside of the buffer
if (index > s.Length)
{
index = s.Length;
}

// Modify string
if (!insertMode) // then overwrite mode
if (!insertMode && index < s.Length) // then overwrite mode
{
s = s.Remove(index, 1);
}

s = s.Insert(index, keyInfo.KeyChar.ToString());
index++;

Expand Down