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

Pasting causes text to seemingly cascade to the right #1343

Open
MostHated opened this issue Jun 3, 2019 · 4 comments
Open

Pasting causes text to seemingly cascade to the right #1343

MostHated opened this issue Jun 3, 2019 · 4 comments

Comments

@MostHated
Copy link

MostHated commented Jun 3, 2019

Description of the problem or steps to reproduce

Whenever I try and paste a decent block of text it seems to all just keep flowing to the right as seen below. - Side note, the newest build I see is from all the way back in Aug 9, 2018, is this right? There has been no updates or anything since then?

The text I copied was this:

Specifications

Version: 1.4.1
Commit hash: 1856891
Compiled on August 10, 2018

             /////////////                mosthated@mosthated-pc
         /////////////////////            ----------------------
      ///////*767////////////////         OS: Pop!_OS 19.04 x86_64
    //////7676767676*//////////////       Host: MS-7B79 2.0
   /////76767//7676767//////////////      Kernel: 5.0.0-15-generic
  /////767676///*76767///////////////     Uptime: 10 hours, 20 mins
 ///////767676///76767.///7676*///////    Packages: 3097 (dpkg), 8 (flatpak), 8 (snap)
/////////767676//76767///767676////////   Shell: zsh 5.5.1
//////////76767676767////76767/////////   Resolution: 1920x1080, 2560x1080, 1920x1080
///////////76767676//////7676//////////   DE: Unity
////////////,7676,///////767///////////   WM: GNOME Shell
/////////////*7676///////76////////////   WM Theme: Adwaita
///////////////7676////////////////////   Theme: Pop-slim-dark [GTK2/3]
 ///////////////7676///767////////////    Icons: Adwaita [GTK2/3]
  //////////////////////'////////////     Terminal: extraterm
   //////.7676767676767676767,//////      CPU: AMD Ryzen 5 2600 (12) @ 3.400GHz
    /////767676767676767676767/////       GPU: NVIDIA GeForce RTX 2070
      ///////////////////////////         Memory: 9912MiB / 32175MiB
         /////////////////////
             /////////////                                        
@samuelludwig
Copy link

I am having this same issue on Windows 10, also on version 1.4.1.

@Kissaki
Copy link

Kissaki commented Nov 2, 2024

micro seems to interpret pasted text, and indents according to opened [code]/parens blocks as if typing each character individually, one after another.

The option paste is documented to evade this behavior, but even with it set to true, I see this broken pasting behavior.

I also looked at the clipboard option, the copy-paste docs, and made sure Windows Terminal supports OSC 52, which it supposedly does since 2019, and I set clipboard to terminal, but copy and paste did not work at all within micro, after removing the terminal ctrl+c ctrl+v keybindings.

A simple example like the following is sufficient to reproduce. Select all, copy, and paste.

test {
	aaa
}

Pasting results in ({ input adding an additional }, and newline adding an additional indent)

test {
		aaa
		}
}

With -paste true I would expect no additional } to be inserted. But it is.

@Andriamanitra
Copy link
Contributor

This is a very old issue. Micro 1.4.1 was released in 2018, at which point paste option did not even exist yet. I think it may even be fixed already, or at least I can't reproduce it any more. (Although there are still some weird edge cases when smartpaste is enabled that are to the best of my knowledge actually impossible to handle, see #3001 and the discussion in #3002 (review)).


@Kissaki I don't think your issue is related to this one. Your issue sounds more like #1518 although I'm unable to reproduce it on my machine (micro 2.0.14 on x86_64 Linux using Terminator terminal emulator). Could you verify that the issue still happens on latest micro version and if it does, open a new issue with more information about your setup:

  • Which operating system and terminal emulator you're using
  • Output of micro -version
  • The configuration values you're using for paste, clipboard, and autoclose when the issue occurs. You can check these by running eg. show clipboard in micro's command prompt.

help copypaste may also contain relevant information for you.

@Kissaki
Copy link

Kissaki commented Nov 3, 2024

It works fine when going around Windows Terminal copy and paste. I bound ctrl+f1 and ctrl+f2 in micro to use unbound keys for copy and paste. That worked.

Disabling autoclose and autoindent also worked.

When pasting through Windows Terminal the issue occurs, whether clipboard is external or terminal. When pasting with the micro bound keys and terminal being set, it says No clipboard received from terminal.

So there's two ways it works. And it seems to me like Windows Terminal may not actually support OSC 52 or micros interfacing of it.

My interpretation of this ticket is thus that it's a terminal setup issue. I assume the issue occurs when the terminal pastes through individual character input, in which case micros default autoclose and autoindent take effect.

I wonder if a different default would be appropriate or other UX/feedback improvement could reduce confusion regarding this. Noting mass-input may seem like undesirable logic.

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

4 participants