Skip to content
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

Copy from micro to another program does not work when micro running over ssh from Git Bash #3275

Open
harri-pasanen opened this issue Apr 29, 2024 · 5 comments

Comments

@harri-pasanen
Copy link

harri-pasanen commented Apr 29, 2024

Description of the problem or steps to reproduce

Copy from micro does not work, paste do micro does work.

Specifications

micro -version
Version: 2.0.13
Commit hash: 68d88b5
Compiled on October 21, 2023

OS: Running micro on linux
Terminal: Windows Git Bash

I'm running Git Bash on MS-Windows, and doing a ssh from there to linux VM.
Usually I hit Ctrl-Ins to copy the text from the terminal, and Shift-Ins to paste to terminal.
This works if I use nano or vi, but copying from micro does not work.

Ctrl-C in micro seems to copy, but only within micro.

@harri-pasanen harri-pasanen changed the title Ctrl-C copy from micro to another program does not work when micro running over ssh from Git Bash Copy from micro to another program does not work when micro running over ssh from Git Bash Apr 29, 2024
@dmaluka
Copy link
Collaborator

dmaluka commented Apr 29, 2024

https://github.com/zyedidia/micro/blob/master/runtime/help/copypaste.md

@harri-pasanen
Copy link
Author

Unfortunately the help link on copypaste did not list Git Bash among the supported terminals on Windows. Actually it does not mention any Windows terminals that I know of.

The only workaround I could find was settings.json as follows:

{
"mouse": false,
"ruler": false
}

And then doing the copy with mouse select followed by Ctrl+Insert.

Related, is there any way to toggle the ruler from the keyboard, rather than setting in permanently in the settings.json?

@Andriamanitra
Copy link
Contributor

Related, is there any way to toggle the ruler from the keyboard, rather than setting in permanently in the settings.json?

By default Ctrl-r is bound to toggle the ruler (you can read all the default keybindings in help defaultkeys). To bind it to another key you can use the ToggleRuler action in your bindings.json.

More generally you can modify any setting with the set/setlocal commands: setlocal ruler off.

@dmaluka
Copy link
Collaborator

dmaluka commented Apr 30, 2024

Unfortunately the help link on copypaste did not list Git Bash among the supported terminals on Windows. Actually it does not mention any Windows terminals that I know of.

So I guess you'd need to find out yourself if your terminal supports OSC 52.

@harri-pasanen
Copy link
Author

The terminal in windows Git Bash seems to be mintty:
https://mintty.github.io/ unfortunately that does not fully support OSC 52, mintty/mintty#258 seems to have rejected that on security grounds.

But to recap, when I disable mouse in micro, I can use mouse to select in the terminal and copy using terminal keys (Ctrl-Insert). This seems make it on-par with vim or nano, so good enough.

Thanks for all the help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants