I need to right click to paste which everything but aligned with everything else. On Mac's terminal you can just "Cmd + V" everywhere.
Good find.
It looks like a PSReadLine issue.
You can verify this by running Remove-Module PSReadLine
in your session (which is obviously not a real solution, as it disables all PSReadLine features), at which point the W10 console windows' native selection and copy & paste features start working.
I suggest posting an issue there - correct, @iSazonov?
Could you please test on Linux too?
@iSazonov:
Linux terminals typically use 鈱冣嚙C and 鈱冣嚙V rather than 鈱僀 and 鈱僔.
I can confirm that 鈱冣嚙C and 鈱冣嚙V work as expected in the default terminal on Ubuntu 16.04.
@mklement0 Thanks for the test!
After executing Remove-Module PSReadLine
Ctrl + V works fine again on Windows 10 (Creators Update)/PS6beta4.
@lzybkr Could you please comment the Issue?
Another, slightly unrelated question:
When I launch "Ubuntu Bash" in PS and want to use Ctrl + V
as well, I get ^V
-- only right-click works. With https://conemu.github.io/ it works fine but I do not want to use it because if its preferences bloat.
@loxal: I don't think that's a PowerShell problem; bash.exe
is in control of keyboard handling, and you get the same (broken) behavior whether you invoke it from PowerShell or directly, via the official shortcut.
PSReadline depends on winforms for clipboard support, but winforms is not in .Net Core. We likely need to extract the clipboard p/invoke code from winforms to get copy/paste support in PSReadline, but that still won't help on non-Windows platforms that might not support a clipboard at all.
If it work without PSReadline why we need the clipboard p/invoke ?
Cooked mode command line editing (conhost) supports basic selection and clipboard, but isn't extensible, so PSReadline uses raw mode and loses some things like clipboard support.
Is there no way to passthrough for clipboard support?
Not really, there could be some horrible hack, but no clean way.
@lzybkr Thanks for clarify!
Unix doesn't seem to have a common clipboard 馃槙. I guess we have to fix at least Windows.
Native API:
https://msdn.microsoft.com/en-us/library/windows/desktop/ms649048%28v=vs.85%29.aspx
https://msdn.microsoft.com/en-us/library/windows/desktop/ms649016(v=vs.85).aspx#_win32_Copying_Information_to_the_Clipboard
WinForms uses ComObj OleGetClipboard
https://referencesource.microsoft.com/#System.Windows.Forms/winforms/Managed/System/WinForms/Clipboard.cs,f4f3734655d33a95
Any movement on this? Would love to be able to get my ctrl + v back :)
+1 with @aarsan
This works in Windows PowerShell without doing "remove-module psreadline", but not in PSCore 6.0.0.
In PSCore 6.0.0, only works if I do the "remove-module psreadline".
:)
Run Install-Module PSReadLine -AllowPrerelease -AllowClobber -Force
and restart, you'll have 2.0.0-beta1
which fixes most of the issues people have had.
Awesome. Worked, but I had to add the -SkipPublisherCheck
argument. Thanks!
I think we can close the Issue - with PSReadline 2.0.0 we got Ctrl-V
and Ctrl-C
on Windows back.
In which version of PowerShell Core will PSReadline 2.0.0 land?
@Hrxn - hopefully 6.1
Any progress on this? Still not working with 6.0.2 / PSReadLine 1.2
You can install PSReadLine 2.0.0-beta1. Beta2 will hopefully ship with the next preview of 6.1.
@lzybkr:
Thanks for fixing most of the issues in v2, on all platforms.
The one thing that still doesn't seem to work on _Unix_ platforms is copying _keyboard-based_ selections to the clipboard.
What would be required to support that?
@mklement0 - I haven't really looked into clipboard support for non-WIndows - I'd sort of assumed the only viable approach was to use an external utility like pbcopy
or xclip
or whatever the tool might be called.
@lzybkr:
Indeed: on macOS it is pbcopy
, on freedesktop.org-compliant Linux distros (X11-based desktops) it is the xclip
utility, which, unfortunately, isn't preinstalled.
My ClipboardText
module provides a PS wrapper around these (including around clip.exe
on Windows), if it helps. (It only _warns_ about a missing xclip
and provides installation _hints_, however).
Most helpful comment
Run
Install-Module PSReadLine -AllowPrerelease -AllowClobber -Force
and restart, you'll have2.0.0-beta1
which fixes most of the issues people have had.