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

File name inserted into paste input #77

Closed
frizop opened this issue Jan 13, 2014 · 5 comments
Closed

File name inserted into paste input #77

frizop opened this issue Jan 13, 2014 · 5 comments

Comments

@frizop
Copy link

frizop commented Jan 13, 2014

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.

@lzybkr
Copy link
Member

lzybkr commented Jan 13, 2014

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

@frizop
Copy link
Author

frizop commented Jan 13, 2014

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.

@lzybkr
Copy link
Member

lzybkr commented Jan 13, 2014

^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.

@kayasax
Copy link

kayasax commented Jul 24, 2015

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

@lzybkr
Copy link
Member

lzybkr commented Nov 11, 2017

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants