Micro: CopyPaste working in v.1, broken in v.2

Created on 4 Mar 2020  路  8Comments  路  Source: zyedidia/micro

Hello Zyedidia .
Some sad updates came to version 2 as far as I can see. Using version 1.4.1 I could copy and paste text not only on FreeBSD console, but also on PuTTY session, which I use a lot. With version 2.0.2 it's impossible anymore (((
Micro editor became useless for me as a console terminal, it's not working on ssh neither on pure console, so I had to switch back to vi.
I read comments in help copypaste, but this workaround doesn't make life easier. Why cope/paste had to be broken that way? Is it possible to revert to old way copy/paste functionality?
Best regards,
Sergey.

$ micro -version
Version: 2.0.2
Commit hash: c51f849
Compiled on February 26, 2020

Commit hash:
c51f849
OS:
FreeBSD KPECT 12.0-STABLE FreeBSD 12.0-STABLE KPECT amd64
Terminal:
urxvt-unicode

Most helpful comment

This should now be fixed in the latest nightly build.

All 8 comments

Could you describe what methods you are using to copy/paste (micro keybinding or terminal keybinding)? Are you working over ssh? Copy and paste has not changed substantially between 1.4.1 and v2.

I believe that I use micro copy-paste method. Select some text with for example Ctrl+Shift+Arrow and press Ctrl+C then move cursor to another place and paste Ctrl+V. That method I used on both console and when I connected from one host (usually by using PuTTY) to another host. This still works for me with v.1.4.1 but with this version https://github.com/zyedidia/micro/releases/download/v2.0.2/micro-2.0.2-freebsd64.tar.gz I'm not able to at least paste.

Experiencing the same issue both on SSH and WSL instance. For both, I attempted to use terminal keybinding and adjusted settings about the Ctrl-C/V keybinds.

Hello.
I've figured out one interesting peculiarity.
Copy/Paste still doesn't work on the FreeBSD's console with v2.0.3, but after I've uninstalled xclip Copy/Paste has begun to work again, this time with message: "Pasted clipboard (install xclip for external clipboard)"
I believe that's because micro calls xclip even on console, where xorg is not avalable. Xclip requires xorg to be running.
Best regards.

Hello @zyedidia! First off, thank you for your work on this excellent editor. It is my editor of choice when working on the command line 馃槃

Unfortunately, I am experiencing the problem described in this issue. Here is what I am seeing:

I am connected via SSH from my Mac to a Raspberry Pi. The micro editor is launched and I am working in a document. I am attempting to Ctrl-C and Ctrl-V text within the same document in micro. _(Note that I am not trying to copy/paste between the Mac and the Pi over SSH. I am aware that requires a different approach, like disabling mouse reporting in the macOS terminal settings.)_

Note that Ctrl-C and Ctrl-V in the same file over SSH works correctly in micro-1.4.1 (running on the same Raspberry Pi, and connected via SSH from the same Mac). Something must have changed since micro-1.4.1. Also note that if I locally open the Terminal from the Raspbian GUI and launch micro-2.0.3 that Ctrl-C and Ctrl-V in same file works correctly there, so it must also have something to do with running micro in an SSH session.

Here is a short video of the issue with micro-2.0.3:
https://www.youtube.com/watch?v=DtJUCCxklV8

EDIT: Here is the same thing working with micro-1.4.1:
https://www.youtube.com/watch?v=xyFzixPqgKE

I am using this release of micro:
https://github.com/zyedidia/micro/releases/download/v2.0.3/micro-2.0.3-linux-arm.tar.gz

micro -version
Version: 2.0.3
Commit hash: f594686
Compiled on April 10, 2020

The Raspberry Pi is running Raspbian Linux 10 (buster).

Let me know if there is anything else you would like me to try, or any other information you need about my setup. Thanks again!

Thanks for the detailed info. I believe I know why this issue is happening and what change in zyedidia/clipboard caused it. The issue is that xclip/xsel is installed on the system, but an X server is not available, so even though micro thinks xclip/xsel should work (and thus tries to copy/paste to the external clipboard), they do not. The solution would be to have micro check for an X server before concluding that an external clipboard is available.

This should now be fixed in the latest nightly build.

I am happy to report the latest nightly build resolves this issue:

Version: 2.0.4-dev.3
Commit hash: 74523d2
Compiled on April 21, 2020

Copy/paste now works properly! The editor now reports (install xclip for external clipboard) in the status bar after a copy or paste operation in an SSH session.

Thanks for your help, and keep up the great work with micro! 馃憤

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Mohamed3on picture Mohamed3on  路  3Comments

Bigguy34 picture Bigguy34  路  3Comments

nabeelomer picture nabeelomer  路  4Comments

Rbagman picture Rbagman  路  4Comments

rishabh96b picture rishabh96b  路  3Comments