Skip to content

File name inserted into paste input #77

Closed

Description

@frizop

Pasting in the following three lines causes the third line to insert the first tab completed file name (for me, it's .berkshelf):

function Get-Foo {
$defaultDisplayPropertySet = New-Object System.Management.Automation.PSPropertySet('DefaultDisplayPropertySet',[string[]]$defaultProperties)
$PSStandardMembers = [System.Management.Automation.PSMemberInfo[]]@($defaultDisplayPropertySet)

Please note, that there are one tab characters preceding the second and third lines.

Activity

  1. lzybkr commented on Jan 13, 2014

    @lzybkr
    Contributor

    You're using the menu or right click, right? If so, I'm aware of the issue, I just haven't come up with a fix I'm happy with yet.

    Note that pasting tabs is a problem with a default PowerShell installation, but mostly nobody notices. It usually inserts nothing (no tab or even spaces) or if the tab is in the middle of the line, it will actually try completion and probably mess things up.

    As a workaround, you can use Ctrl+V to paste in Windows mode or bind the Paste function to the key of your choice. As a bonus, pasting this way is much faster.

    I

  2. frizop commented on Jan 13, 2014

    @frizop
    Author

    Hmm, Ctrl+V does indeed work (while putting in lots of ^I^I characters everywhere) but the code comes out clean so that's all I care about.

    One last thing with this, when I Ctrl+V a huge block of code (and it's fast!) and then on the very next line Ctrl+R, the screen refreshes, scrolls all the way to the top of the buffer and starts doing my Forward Search. Is this known as well?

    Edit: Oh I see what it's doing, because of the large 100 line paste when I backwards search, thats the first item it finds so it flushes my buffer out so it can display those 100 lines. Man, that's just goofy to have those 100 lines show up over and over again like that.

  3. lzybkr commented on Jan 13, 2014

    @lzybkr
    Contributor

    ^I is tab - Ctrl+I is 0x9 and that's how it gets rendered. Maybe I should change it to display spaces.

    Paste with right click is also faster w/ PSReadLine than without, but Ctrl+V is fastest because it doesn't simulate entering each key.

    The Ctrl+R experience isn't great with long blocks of code. I guess I could truncate the buffer some - ensuring the prompt, matching text, and search string line are all on the same screen. I'll play around with this idea some when I get a chance.

  4. kayasax commented on Jul 24, 2015

    @kayasax

    I have same problem here, but ctrl+V only paste the first line of my clipboard ...? (I'm using powershell within ConEmu)

  5. lzybkr commented on Nov 11, 2017

    @lzybkr
    Contributor

    Closing in favor of #579 which covers all of the known issues with right-click paste.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions