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
Pasting in windows/linux #153
Comments
I'm closing this for now since it seems outside the scope of what jline can do, but please re-open if I'm wrong! Thanks for letting us know, @adriaanm! |
Well, it could do it before: Pasting with ctrl+v used to work just fine before with the old jline of Scala 2.10.3 but it stopped working in Scala 2.11.1. So I guess it is possible? |
"On my Linux VM, the terminal uses ctrl-shift-v to paste, and that key combo also works fine for me in jline master" In the Scala REPL, Ctrl-V is very different than Ctrl-Shift-V. The latter essentially sends one character at a time, so it's as if you typed it. OTOH the first essentially activates the REPL's paste mode. Two differences:
|
I see that we still have the old case PASTE_FROM_CLIPBOARD:
success = paste();
break; and any other required machinery so that consumers, if they like, can re-map A quick tweak locally appears to say that (at least on OSX, under zsh and bash) |
It would be really great if the old ctrl+v feature could be reimplemented. Was the old implementation behaving consistently across platforms? (I got the impression that ctrl+v "just worked" before on all platforms.) |
Another thought for a patch is to fix #149 and add a sample triggered action for the clipboard-accessing paste behavior that people could use (and Scala could wire up for this use case so end users don't need to know about it). I'm kind of liking this idea because it makes explicit the fact that reaching into the clipboard isn't a typical readline feature, and puts the AWT dependencies outside of the core ConsoleReader. Of course since |
Add support for the paste-from-clipboard operation, even if there’s no default mapping for it. Partial fix for #153
With the above 08ee342 fix, it is now simply a matter of adding a key mapping |
There's a bug report in Scala that pasting (via ctrl-v) doesn't work in Windows/Linux.
@adriaanm said (on this commit):
Could this explain why paste no longer works for our Scala REPL users now that we use jline 2.11? (See https://issues.scala-lang.org/browse/SI-8644) -- /opportunistic-cc @trptcolin
My reply:
I gather that it's only an issue for users on Linux & Windows from the comments there (I use OSX too, where command-v works).
On my Windows terminal clients (cygwin, cmd.exe, git bash), I can't find any evidence that ctrl-v works in any console app, including the shell - I always have to use the mouse, which works fine in jline master on my Windows VMs. A little googling says apparently there's an AutoHotKey script that lets you use ctrl-v, not sure if that's what people are using or if they're just surprised at ctrl-v not working by default?
On my Linux VM, the terminal uses ctrl-shift-v to paste, and that key combo also works fine for me in jline master.
The clipboard is an OS responsibility, so I'd expect the OS to be the thing sending that information down the STDIN stream. I guess I'm not getting how jline can help? Right now the only helpful possibility I'm seeing is the new KillRing/yank functionality that'll go out with the next release.
It looks like
QUOTED_INSERT
is the Operation that gets fired on Ctrl-V, for what it's worth.The text was updated successfully, but these errors were encountered: