Maximus5 / ConEmu

Customizable Windows terminal with tabs, splits, quake-style, hotkeys and more
https://conemu.github.io/
BSD 3-Clause "New" or "Revised" License
8.53k stars 572 forks source link

[bug] Block-copy also copies structure #2374

Closed mrx23dot closed 2 years ago

mrx23dot commented 2 years ago

Versions

ConEmu build: ConEmuPack.210912.7z OS version: Windows 10 x64, win7 x64 Used shell version cmd admin

Problem description

"Block copy" out works fine, but when I try to paste it in to another app it tries to paste it as block, not as simple text.

Steps to reproduce

  1. Have a full screen of text in console
  2. Do a big block copy from the middle
  3. Open a text editor (eg. notepad.exe) with full of text
  4. Paste text to first line

Actual results

  1. But what happens it tries to be smart an tries to insert the text as block, overriding existing text parts.

Expected results

  1. Now I would expect it to create new lines for the block

Additional files

Using default config. 2021-09-17 11_25_43-Settings  xml  ConEmu 210905  64  {Stable}

block copy out 2021-09-17 11_26_09-

original text in other app 2021-09-17 11_27_35-_ Untitled - Notepad2-mod (Administrator)

after pasting it in 2021-09-17 11_27_20-_ Untitled - Notepad2-mod (Administrator)

what I expect 2021-09-17 11_31_17-_ Untitled - Notepad2-mod (Administrator)

99% of people wouldn't use this mode.

Maximus5 commented 2 years ago

I wonder, isn't that a question for a text editing program? It looks like for me that the user wants to paste a vertical block as simple text, the editor should allow that.

mrx23dot commented 2 years ago

I tried multiple editors they all behave the same way, the problem is that the copied out text has some special characters that modify the pasting operation (i guess).

I would expect basic text to be copied out, especially when I explicitly select that option in settings.

Maximus5 commented 2 years ago

Have you tried these other editors to copy text and paste it after? AFAIK that is expected behavior everywhere.

mrx23dot commented 2 years ago

Yeah you were right, I checked the copied out text with hex editor, and it's what we would expect. The problem is on the receiving side.

2021-09-27 09_20_46-cmd (Admin)

2021-09-27 09_21_10-HxD -  Untitled1

Maximus5 commented 2 years ago

Just to clarify some things.

When ConEmu puts the text into clipboard, it creates several different clipboard formats. For block selection there is a special one AFAIR.

I think it's possible to extend GuiMacro function to copy a block as a text. Not sure if it what's you want?

https://conemu.github.io/en/GuiMacro.html#Copy

mrx23dot commented 2 years ago

Now that's interesting, I verified that conemu differentiates the paste content based on destination.

On the hex editor above it detected that it can only paste one line, so it flatten the block correctly (with new lines). But when I paste into text editor it retains the block information, and also it overrides not just pastes.

And when I copy the content from hex editor to text editor it works as expected.

I think the overriding is not correct in the first place, and not sure if anyone uses the block insertion, I have never seen that in any editors.

Yeah, I would expect block as copied as simple text (with new lines) since I selected: 133768104-b7c594c1-e1b5-4675-9c43-7edd55398620

But I'm sure it behaves the same way for you, try it out, I didn't find it intuitive.