Skip to content

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

Closed

Description

@lzybkr

From sergei (@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

Activity

  1. lzybkr commented on Nov 9, 2016

    @lzybkr
    ContributorAuthor

    From sergei (@vors) on July 27, 2016 6:45

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

  2. lzybkr commented on Nov 9, 2016

    @lzybkr
    ContributorAuthor

    From sergei (@vors) on July 27, 2016 6:47

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

  3. lzybkr commented on Oct 17, 2017

    @lzybkr
    ContributorAuthor

    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.

  4. vors commented on Oct 23, 2017

    @vors
    Contributor

    Trying to deploy the linked zip file on macOS and https://github.com/PowerShell/Microsoft.PowerShell.Archive/issues/11 shows its head again

  5. vors commented on Oct 23, 2017

    @vors
    Contributor

    Verified that this is fixed, thank you Jason Shirk (@lzybkr) !

  6. lzybkr commented on Nov 4, 2017

    @lzybkr
    ContributorAuthor

    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.

  7. nanoant commented on Feb 16, 2018

    @nanoant

    Jason Shirk (@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?

  8. rkeithhill commented on Feb 16, 2018

    @rkeithhill
    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.

  9. lzybkr commented on Feb 16, 2018

    @lzybkr
    ContributorAuthor

    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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions