Replies: 1 comment
-
Set-PSReadLineKeyHandler -Chord 'y,y' -ViMode Command -ScriptBlock {
$line = $cursor = $null
[Microsoft.PowerShell.PSConsoleReadLine]::GetBufferState([ref]$line, [ref]$cursor)
if ($env:WSL_DISTRO_NAME) {
if (Get-Command win32yank.exe -ErrorAction SilentlyContinue -OutVariable clip) {
$line | & $clip -i
} else {
[System.Console]::Beep()
}
} else {
Set-Clipboard $line
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
sharpchen
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'd like to yank current line to system clipboard, but I can't find a way to get current line content.
Beta Was this translation helpful? Give feedback.
All reactions