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