8000 Make PSReadline render correct portion of prompt on Unix when it's a multi-line string by daxian-dbw · Pull Request #3867 · PowerShell/PowerShell · GitHub
[go: up one dir, main page]

Skip to content

Make PSReadline render correct portion of prompt on Unix when it's a multi-line string #3867

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 26, 2017
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 8000 to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/Microsoft.PowerShell.PSReadLine/ReadLine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,13 @@ private void Initialize(Runspace runspace, EngineIntrinsics engineIntrinsics)

#if UNIX // TODO: not necessary if ReadBufferLines worked, or if rendering worked on spans instead of complete lines
string newPrompt = GetPrompt();
int index = newPrompt.LastIndexOf('\n');
if (index != -1)
{
// The prompt text could be a multi-line string, and in such case
// we only want the part of it that is shown on the input line.
newPrompt = newPrompt.Substring(index + 1);
}
var bufferLineCount = (newPrompt.Length) / (_console.BufferWidth) + 1;
_consoleBuffer = ReadBufferLines(_initialY, bufferLineCount);

Expand Down
0