micro-editor / micro-editor/micro

Disable mouse support temporarily when copying/pasting

Open
#1,880 8 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
29.6k
Forks
1.4k
Avg merge
2d 18h
Merged PRs (30d)
10

Description

Description of the problem or steps to reproduce

This is a bit of an odd one.

Is it possible to disable mouse support when click-dragging or using the 'copy' hotkey? I would like my terminal/system clipboard to handle all clipboard stuff, but still retain the ability to use my mouse to select lines in Micro. This doesn't seem to affect pasting, oddly.

Currently, these are the scenarios that happen:

  • In Micro, with mouse: false, I can copy from Micro or my system, and paste into Micro as expected. However, this obviously disables Mouse support.
  • In Micro, with mouse: true and default keybinds, if I attempt to copy I get Copied selection (install xclip for external clipboard) in the status bar.
    • By disabling the CtrlC and CtrlV hotkeys in my terminal, I can confirm that Micro has copied the selection into its internal clipboard, and can paste it within Micro. My system clipboard is untouched.
    • If the hotkeys in my terminal are enabled, then CtrlC displays the same message, but does not affect the terminal/system clipboard, and pasting just pastes whatever is in my system clipboard to the terminal written as a block of text (confirmed in raw mode).
  • In Micro, with mouse: true, and "Ctrl-C": "", "Ctrl-V": "" in keybinds, then pasting from the system clipboard works, but copying from Micro does nothing.

It seems that when Micro has mouse support enabled, Windows Terminal passes through all mouse highlighting to Micro, so you can no longer highlight something to copy it using terminal hotkeys, as as far as the terminal is concerned, nothing is selected. I can confirm this in raw mode, as when mouse support is enabled, ctrl+c is passed through as \x03, whereas ctrl+v is the block of text in my system clipboard.

Does anybody have any suggestions on how to fix this? :) This may be considered a Windows Terminal issue, if so, please let me know and I'll go open an issue over there.

Specifications

Commit hash: 60846f5, Version 2.0.6
OS: Ubuntu 20.04.1 LTS running in WSL2 on Windows 10
Terminal: Microsoft Terminal (I have no idea which version, not entirely sure how to find out)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the three mouse and Ctrl-C/Ctrl-V configurations described on Ubuntu 20.04.1 under WSL2 with Windows Terminal, comparing Micro's internal clipboard with the terminal/system clipboard. No source files or tests are identified in the issue; done means the requested copy and paste behavior works while mouse line selection remains available.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.