zyedidia / micro

A modern and intuitive terminal-based text editor
https://micro-editor.github.io
MIT License
25.15k stars 1.17k forks source link

Copy/Paste Breaks Between Micro and External Program #2146

Open ducksoverip opened 3 years ago

ducksoverip commented 3 years ago

Description of the problem or steps to reproduce

There are several situations where Micro's copy-paste support apparently fails, especially when attempting to copy from or paste to locations outside the terminal, such as copying from a webpage or pasting to an external text editor.

Case 1 | From: Micro | To: Micro | Result: works for both Shift/Ctrl+Ins and Ctrl+C/V Case 2 | From: Terminal Window | To: Micro | Result: works only for Shift/Ctrl+Ins (terminal only supports that shortcut) Case 3 | From: External Program (eg, webpage) | To: Micro | Result: works only for Shift+Ins on paste; works for Ctrl+C or Ctrl+Ins on copy Case 4 | From: Terminal Window | To: External Program | Result: works only for Ctrl+Ins on copy; works for either on paste Case 5 | From: Micro | To: External Program | Result: Does not work for any shortcut Case 5 | From: Micro | To: Terminal Window | Result: Does not work for any shortcut

Cases 3 and 5 are the most frustrating. It's easy to imagine cases where I might want to copy text from files in Micro to paste elsewhere, especially since I use Micro on a remote machine and direct downloading of files is a hassle. Since Micro promises access to the system clipboard, I'm annoyed that it seems to break when I want to copy text from Micro to anywhere else.

This occurs regardless of whether or not I set the "clipboard" setting to external or terminal.

Specifications

Clarification on specs: I use my home PC running Win10 with Git Bash for Windows to ssh in to the Stampede2 supercomputer, which runs CentOS 7. I have micro installed to my home directory on Stampede2 and use it to edit code to be run there.

Commit hash: 6bc498e6 OS (local machine): Windows 10 Build 19042 OS (ssh machine): CentOS Linux 7 (Core) Terminal: Git Bash for Windows (xterm-256 mode)

ibrokemypie commented 3 years ago

Getting the same issue with commit hash de35d00, on sway, using clipboard=terminal (in kitty, foot, alacritty) Using clipboard=external also doesnt work unless installing wl-clipboard-x11 (replaces xclip/xsel with wayland versions_

mrx23dot commented 2 years ago

Why does it work out of the box with nano + kitty? And not with micro + kitty? (not even with mouse-right click, which works in normal bash)

pavanvo commented 2 years ago

Still same problem on 4864590

Looks like micro have own buffer for ctrl+c Ctrl+v shortcats