1

Original question: (please read update in this section below) I am running Ubuntu 16.04 on Virtualbox on a Windows 10 Host. Accessing the Virtualbox through ssh running through Bash on Windows. I can get in and edit everything fine However, when I try to paste anything from windows application to VIM or from VIM to windows applications with keyboard shortcuts it doesnt work. None of the native keys work to copy from VIM on bash on Windows to windows apps. Within VIM copy paste works as usual.

For future visitors to this question, I thought I would compile some references to show that copy-pasting to and from windows clipboard to vim running through Putty and WSL doesnt work:

  1. Putty manual reference showing that by design you cant paste into putty from windows: https://superuser.com/a/85774/658319
  2. Running bash on WSL and ssh into a linux server cant be used to copy or paste (check COPY and PASTE at bottom of article) from windows to VIM on linux or from VIM on linux to window with keyboard only: https://alliterationapplications.com/putty-vs-ubuntu-on-windows/

Alternative software to being able to copy-paste to and from vim running on linux:

  1. Software solutions:

    1.1. kitty: https://superuser.com/a/1112362/658319

    1.2. Autohotkey: https://superuser.com/a/1112362/658319,

    1.3. Superputty: https://superuser.com/a/450812/658319

    1.4. conEmu: https://superuser.com/a/450812/658319

    1.5. using windows Mouse simulation keys: https://superuser.com/a/426311/658319

    1.6. using Gnu screen app: https://superuser.com/a/85785/658319, https://superuser.com/a/273490/658319

  2. through modificaitons on putty (didnt work for me): https://www.quora.com/How-can-you-copy-all-contents-of-a-text-file-opened-in-vim-through-Putty-on-a-Windows-desktop-to-Windows-clipboard/answer/Lifu-Tang

  3. Other editors similar to VIM which might have easier copy-paste functionality (please test and mention if these work. I will update the answer):

    3.1. NeoVIM

    3.2. Atom

  4. Connecting using SSH on Bash on Windows to linux server and copy-pasting to/from vim

    4.1. Use VCX server: https://stackoverflow.com/a/44534222/4752883 4.2. Use Autohotkey: https://stackoverflow.com/a/44534222/4752883

Any other potential suggestions for keyboard only copy-paste to vim through bash on wsl/putty/other terminal emulators to linux?

P.S. please dont post any answers which use mouse in way or form for copy paste.. trying to keep it clear here.. as most users who are asking this question are asking for a keyboard only solution.

5
  • This is the same question asked over and over again. Look up X11 Forwarding.
    – romainl
    Commented Jul 24, 2017 at 5:30
  • @romainl.. Appreciate your time and thanks for letting me know about X11 Forwarding.. didnt see that term mentioned before.. and I had spent quite a bit of time trying to debug this..had tried almost all solutions presented on stackoverflow and superuser.
    – alpha_989
    Commented Jul 24, 2017 at 14:41
  • There are quite a few conflicting answers.. perhaps because the environment (whether they are running putty on linux etc). I tried adding some references and perhaps we can compile the references to make i clearer for new comers. If there is such a high volume of questions, its probably not true that everybody is just starting a new question because they are lazy.. its probably hard to find a good answer.. so a comprehensive resource addressing the difference scenarios might be very helpful..
    – alpha_989
    Commented Jul 24, 2017 at 14:41
  • AFAIK. this is the first time somebody has asked this particular combination copy paste to and from vim running on "ssh from (bash on windows 10) to Ubuntu server"..using keyboard only
    – alpha_989
    Commented Jul 24, 2017 at 14:46
  • 1
    For clipboard sharing via SSH to work between two systems you need a) a working clipboard on each system (via X11), b) a clipboard-enabled Vim build on each system (typically GVim), and c) X11 forwarding enabled upon connection (-X).
    – romainl
    Commented Jul 24, 2017 at 15:23

1 Answer 1

1

As per the putty documentation, it does not allow keyboard shortcuts because if you press any key it is reflecting on the remote machine.

https://superuser.com/questions/85772/putty-how-to-select-text-and-copy-text-using-keyboard-only

https://superuser.com/questions/490722/putty-alternative-with-keyboard-copy-paste

1
  • I wasnt originally asking for solutions to copy pasting from putty to vim on linux.. but from (bash on ubuntu) for windows 10 Aniversery update (msdn.microsoft.com/en-us/commandline/wsl/about) to vim on running on linux server.. turns out keyboard only copy-paste is not possible at all...
    – alpha_989
    Commented Jul 24, 2017 at 14:44

Not the answer you're looking for? Browse other questions tagged or ask your own question.