Merge pull request #1712 from PowerShell/ealexjordan/filenamecrash

Fixing Crash on File Name Extending BufferWidth
This commit is contained in:
Andy Schwartzmeyer 2016-08-10 18:27:44 -07:00 committed by GitHub
commit 4e23d6e1ee

View file

@ -557,13 +557,18 @@ namespace Microsoft.PowerShell
_visualSelectionCommandCount = 0;
_statusIsErrorMessage = false;
_consoleBuffer = ReadBufferLines(_initialY, 1 + Options.ExtraPromptLineCount);
#if UNIX // TODO: not necessary if ReadBufferLines worked, or if rendering worked on spans instead of complete lines
string newPrompt = GetPrompt();
var bufferLineCount = (newPrompt.Length) / (_console.BufferWidth) + 1;
_consoleBuffer = ReadBufferLines(_initialY, bufferLineCount);
for (int i=0; i<newPrompt.Length; ++i)
{
_consoleBuffer[i].UnicodeChar = newPrompt[i];
}
#else
_consoleBuffer = ReadBufferLines(_initialY, 1 + Options.ExtraPromptLineCount);
#endif
_lastRenderTime = Stopwatch.StartNew();