Skip to content
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

Multi-line prompt incorrectly displayes the last line with PSReadLine #470

Closed
lzybkr opened this issue Nov 9, 2016 · 9 comments
Closed

Comments

@lzybkr
Copy link
Member

lzybkr commented Nov 9, 2016

From @vors on July 3, 2016 5:16

Steps to reproduce

function prompt
{
    "PS $pwd`n Hello`n World>"
}

Type 'foo' with the new prompt

Expected behavior

PS /Users/vors/dev/PowerShell/src
 Hello
 World>foo 

Actual behavior

PS /Users/vors/dev/PowerShell/src
 Hello
PS /Usefoo  

Environment data

> $PSVersionTable
Name                           Value                                                                                                        
----                           -----                                                                                                        
PSVersion                      5.1.10032.0                                                                                                  
PSEdition                      Linux                                                                                                        
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                                      
BuildVersion                   3.0.0.0                                                                                                      
GitCommitId                    v0.5.0-257-g07501f1d3a02c4e70da8a2693e3d0f833a61cf65                                                         
CLRVersion                                                                                                                                  
WSManStackVersion              1.0                                                                                                          
PSRemotingProtocolVersion      2.3                                                                                                          
SerializationVersion           1.1.0.1   

Copied from original issue: PowerShell/PowerShell#1269

@lzybkr
Copy link
Member Author

lzybkr commented Nov 9, 2016

From @vors on July 27, 2016 6:45

Also, Set-PSReadlineOption -ExtraPromptLineCount 3 behaves weirdly, could be related

@lzybkr
Copy link
Member Author

lzybkr commented Nov 9, 2016

From @vors on July 27, 2016 6:47

I verified, problem doesn't repro, if I remove PSReadLine.

@lzybkr
Copy link
Member Author

lzybkr commented Oct 17, 2017

I believe this is fixed in #561.

I'll publish a pre-release version to the PowerShell Gallery as soon as they support pre-releases.

If you'd like to try a fix before that, you can build the lastest yourself from the master branch, or
grab a build from AppVeyor like this one.

Note the version number is now 2.0, so be sure to copy the contents to \PSReadLine\2.0.

@vors
Copy link
Contributor

vors commented Oct 23, 2017

Trying to deploy the linked zip file on macOS and PowerShell/Microsoft.PowerShell.Archive#11 shows its head again

@vors
Copy link
Contributor

vors commented Oct 23, 2017

Verified that this is fixed, thank you @lzybkr !

@lzybkr
Copy link
Member Author

lzybkr commented Nov 4, 2017

I'll have an official prerelease build out next week if you want to verify this is fixed, otherwise you can grab a build out of appveyor here.

@lzybkr lzybkr closed this as completed Nov 4, 2017
@nanoant
Copy link

nanoant commented Feb 16, 2018

@lzybkr Hi, I am sorry, but I think we have regressed with this issue in 2.0.0-Beta1. I have recently upgraded to 2.0.0-Beta1 to fix broken multi-line prompt after console layout #633, and while that one is fixes, it seems that Set-PSReadlineOption -ExtraPromptLineCount 1 no longer works - I also tested latest AppVeyor build. Reverting back to 1.2, makes Ctrl+L properly clear the prompt.
Can we please re-open?

@rkeithhill
Copy link
Contributor

I have a two line (ANSI) prompt string and yeah, I wound up commenting out the line in my profile that was setting Set-PSReadlineOption -ExtraPromptLineCount 1. The prompt worked better after that.

@lzybkr
Copy link
Member Author

lzybkr commented Feb 16, 2018

Please open a new issue - this one was more general.

I'm a little surprised I didn't notice, I added the option for myself and I do use Ctrl+L.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants