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

Paste into Window micro misformats the pasted values #3571

Open
DavidMcGaha opened this issue Dec 12, 2024 · 7 comments
Open

Paste into Window micro misformats the pasted values #3571

DavidMcGaha opened this issue Dec 12, 2024 · 7 comments
Labels

Comments

@DavidMcGaha
Copy link

Description of the problem or steps to reproduce

On Windows, using Windows Terminal in Powershell, pasted lines are mis-formatted compared to format when copied or when pasted into other apps including WSL/Linux micro

Specifications

VB6_Original_copied
Notepad++_pasted
WSL_Linux_micro_pasted
Windows_Terminal_Powershell_pasted

Commit hash:
OS: Windows
Terminal: Windows Terminal/Powershell

Version: 2.0.14
Commit hash: 04c5770
Compiled on August 27, 2024

@JoeKar
Copy link
Collaborator

JoeKar commented Dec 12, 2024

Looks like it misses the carriage return ( resp. \r).
Maybe it has something to do with #3303, but I'm unsure here.

@JoeKar JoeKar added the major label Dec 12, 2024
@fbd-ss
Copy link

fbd-ss commented Jan 3, 2025

Can confirm, copy paste has been an issue for a long time. Maybe a bit more testing before release

@JoeKar
Copy link
Collaborator

JoeKar commented Jan 6, 2025

Can confirm, copy paste has been an issue for a long time. Maybe a bit more testing before release

None of the maintainer has Windows as primary OS.
Especially the Windows variant still has some real major issues.
We try to sort them out, but this is nothing we can solve in short term due to limited free time for maintenance.

Issues which seem to be related with this "staircase" effect are:

There are more, but I'm unsure if they really describe the same situation.

What makes me wonder a bit about this situation is, that the issue seems to exist a very long time already, but no Windows user took the time to take a deep dive into micro's code to help and support?
It is easy to complain, but hard to offer its own free time.

There is definitely some help wanted.

Things to check/reproduce:

@Neko-Box-Coder
Copy link
Contributor

I don't remember this happening to me when using Windows, I have "keepautoindent": true, and "smartpaste": false,

@niten94
Copy link
Contributor

niten94 commented Feb 3, 2025

I think I was able to know why formatting changes, but I do not know a good way to fix it.

The indentation probably changes because autoindent is enabled and text is pasted using key press events. Bracketed paste is not enabled on Windows in the fork and upstream of Tcell, and Ctrl-v is handled by default in Windows Terminal settings.

Bracketed paste seems to be supported on Windows Terminal, but there may be other environments or terminal emulators where the control sequence is displayed because it isn't supported.

There are a lot of issues and questions about using the clipboard, so I think > help copypaste could be rewritten to be able to read easily like other help topics. A link in README.md also needs to be added.

@fbd-ss
Copy link

fbd-ss commented Feb 3, 2025

I never noticed before, but when on a local network, the crazy indent doesn't happen. But when over tailscale, 90% of the time it will do it.

@niten94
Copy link
Contributor

niten94 commented Feb 4, 2025

What is the OS of the machine on the local network and machine accessed using Tailscale where you used Micro, and terminal emulator (like Windows Terminal) you used when accessing both?

In summary, my previous comment was about paste input not distinguished with regular key input, because bracketed paste is not enabled in the Windows version of Micro.

Micro also uses the method that is set in clipboard option to paste if it receives Ctrl-v by default, but Ctrl-v is binded in default Windows Terminal settings so Micro receives pasted content instead. I just noticed that setting clipboard to terminal isn't currently supported on Windows too.

Edit: I'm sorry that my tone wasn't somewhat good. I wasn't in a good mood a bit but I should have not posted at such times. I have tried to rewrite both comments. These can also be done as a workaround on Windows for now:

  • temporarily enabling paste option when pasting (> set paste on|off)
  • using Paste action in micro
    • local session or remote GUI access: setting clipboard option to external
    • Micro on non-Windows platforms (like ssh, probably WSL too): setting clipboard to terminal
    • Windows Terminal
      • binding keys like Alt-v with Paste in micro (bindings.json or > bind Alt-v Paste)
      • removing Ctrl-v binding in Windows Terminal settings

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

No branches or pull requests

5 participants