-
Notifications
You must be signed in to change notification settings - Fork 316
Closed
Labels
Issue-QuestionFor non-bug questions or discussion.For non-bug questions or discussion.
Description
Environment data
PS version: 5.1.16299.251
PSReadline version: 1.2
os: 10.0.16299.15 (WinBuild.160101.0800)
PS file version: 10.0.16299.15 (WinBuild.160101.0800)Steps to reproduce or exception report
Well this is not a bug but a question.
I have this binding in profile.ps1
Set-PSReadlineKeyHandler -Chord Ctrl+V -ScriptBlock {
$clipboard = Get-Clipboard -Raw
$clipboard = $clipboard -replace "&","``&"
[Microsoft.PowerShell.PSConsoleReadLine]::Insert($clipboard)
}When I press Ctrl-V, it will paste the data from system clipboard and & character will be escaped.
It is convenient when the clipboard data is a web link like https://example.com?a=b&c=d .
However, if the clipboard data contains double quotes like this "https://example.com?a=b&c=d" , then there is no need to escape the & character.
How can I do a smart pasting. Thanks :)
Metadata
Metadata
Assignees
Labels
Issue-QuestionFor non-bug questions or discussion.For non-bug questions or discussion.