sakura icon indicating copy to clipboard operation
sakura copied to clipboard

Newline characters are added when copying an unprocessed command from a small window using sakura

Open publicsite opened this issue 1 year ago • 7 comments

Hi,

Multiline paste seems to be a bit funny. Sometimes the lines get pasted and executed OK, other times, it appears some of the pasted lines don't get executed.

I propose testing for this to make sure multiline paste is working correctly, and also so that ALL the commands are actually executed inc. in the right order when pasted into the terminal emulator.

Otherwise sakura is working great for me, thank you for this.

publicsite avatar Aug 18 '24 15:08 publicsite

Hi, glad you like sakura.

Could you send here an example of an multiline paste that is giving you problems? Thanks

dabisu avatar Sep 17 '24 14:09 dabisu

Hi I think I narrowed down the problem.

To reproduce

Type in the terminal emulator all as one line:

/bin/echo "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa[...]"

but do not press return.

Make the terminal emulator window tiny, like 50x50 pixels or something.

Try copying the unprocessed command from the terminal into a text editor.

Output

/bin/echo "aaaaaaa
aaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaa
aaaaa"

You will see that newline characters are added to the copied text.

Expected result

No newline characters should be added by the terminal emulator when copying an unprocessed command from sakura.

publicsite avatar Sep 18 '24 03:09 publicsite

I'm not sure if that is the only issue with multiline but that is 1 of the issues I have found.

EDIT: Oh I just realised I should have filed this using Launchpad. Oops.

EDIT2: If you fix this I will donate $30 USD to Ubuntu.

publicsite avatar Sep 18 '24 03:09 publicsite

I wasn't able to reproduce the problem with those steps, always got a "aaaa[..." text without newlines.

But, if I shrink&make bigger the sakura window multiples times, I noticed that there are issues when the terminal is redrawing the console text and the text is messed up. Unfortunately, libvte is the one doing the redrawing so nothing changed in sakura will improve this situation.

I tested with other terminals. Terminator has the same issue when the window is resized multiple times into a tiny window/bigger window. Gnome terminal imposes a minimum number of columns (33) to avoid (not sure if completely, but it seems better) this issue. Maybe sakura should use too a minimal number of columns...

dabisu avatar Sep 18 '24 10:09 dabisu

I compiled the latest version, and the problem with adding new lines to copied text from an unprocessed command from a small window persists. It seems it is less of a problem with the later version (fewer new line characters added) but still happens for me unfortunately.

I can confirm the text messes up somewhat like you said when scaling the window lots. Unlike the problem of adding new lines, this issue seems to be more persistent on the later version of sakura.

I tested version 3.8.6 and version 3.8.8 FWIW

publicsite avatar Sep 18 '24 16:09 publicsite

I am experiencing this issue as well, no resizing post entering the command needed. If the command is longer than the terminal window, new line characters are added when copied.

https://github.com/user-attachments/assets/6305ccd8-3994-4d1a-82e6-0f9c5a2250d3

This appears to be the same behavior as Gnome Terminal, so isn't much of an issue for me as that's what I'm coming from, but it would be nice addition if it didn't add those new line characters.

https://github.com/user-attachments/assets/099abdc3-9880-4926-924e-c8fb4fd01344

I also confirmed Gnome Terminal's text rendering gets a bit wonky with a lot of resizing.

Kuuchuu avatar Oct 20 '24 19:10 Kuuchuu

Can up the bounty to £50 GBP going to Ubuntu ...

publicsite avatar Oct 20 '24 21:10 publicsite

@Kuuchuu Thanks for the detailed report and video. I followed your steps, but I'm still unable to reproduce it: when I copy the text there aren't newlines inserted. Anyway, as I mentioned in a previous comment, sakura doesn't do any text processing/formating or text redrawing, all is done by the vte library, so this is an vte bug. Closing this issue as there is nothing to be done in sakura.

dabisu avatar Apr 04 '25 07:04 dabisu