telegramdesktop / tdesktop

Telegram Desktop messaging app
https://desktop.telegram.org/
Other
25.82k stars 5.11k forks source link

Pasting of multiline text adds extra newlines #28181

Closed raorn closed 1 month ago

raorn commented 1 month ago

Steps to reproduce

Copy multiline text from a terminal or text editor:

111
222
333

Paste into telegram desktop message input box

Expected behaviour

111
222
333
_

_ - cursor position

Actual behaviour

111

222

333

_

_ - > cursor position

However, this does not happen iff multiline text is copied from code-formatted message from telegram itself.

Operating system

Fedora Linux 39

Version of Telegram Desktop

5.2.3

Installation source

Static binary from official website

Crash ID

No response

Logs

No response

Marku555 commented 1 month ago

Same story on Ubuntu 22.04.4 LTS with Telegram Desktop 5.2.1 - 5.2.3.

saddedmoroz commented 1 month ago

Tg 5.2.3 x64 portable windows version, copy/paste works as expected

raorn commented 1 month ago

5.0.4 Fedora Liniux 39 - works as expected

Aokromes commented 1 month ago

can't reproduce on 5.2.3 static binary running on fedora 40 nor on ubuntu 23.04..

perpostas commented 1 month ago

The same issue is on Telegram Desktop v5.2.3 Ubuntu 22.04.4 LTS

ilya-fedin commented 1 month ago

Can't confirm, there's no such issue

sejtevgenij commented 1 month ago

facing the same issue on Ubuntu 22.04.4 LTS, Telegram v5.2.3 (Linux x64 static binary)

sejtevgenij commented 1 month ago

Fedora 40, Telegram v5.2.3 (Linux x64 static binary)

ilya-fedin commented 1 month ago

Can't confirm on Wayland nor X11.

sadm2014 commented 1 month ago

The same issue is on Telegram Desktop v5.2.3 Ubuntu 22.04.4 LTS Xorg session (xubuntu)

cyberknight777 commented 1 month ago

can confirm on Telegram Desktop v5.2.3 on Arch Linux running X11 with i3WM. However it only happens with terminals, if I copy from my editor (GNU Emacs), it's fine.

ilya-fedin commented 1 month ago

However it only happens with terminals, if I copy from my editor (GNU Emacs), it's fine.

This seem to point to the fact that steps to reproduce aren't full. As I try with a random text editor/terminal and can't reproduce while some exact text editor/terminal has to be used?

cyberknight777 commented 1 month ago

However it only happens with terminals, if I copy from my editor (GNU Emacs), it's fine.

This seem to point to the fact that steps to reproduce aren't full. As I try with a random text editor/terminal and can't reproduce while some exact text editor/terminal has to be used?

FWIW, it happened on both lxterminal and xterm.

ilya-fedin commented 1 month ago

Can't reproduce with the first one and can't copy from the second one at all

ilya-fedin commented 1 month ago

Maybe you folks have some kind of clipboard manager that is not compatible with Qt 6 (the toolkit tdekstop is based on)?

cyberknight777 commented 1 month ago

Can't reproduce with the first one and can't copy from the second one at all

It also happens on tilix btw.

ilya-fedin commented 1 month ago

As tdesktop doesn't handle clipboard, this should be a bug in either some system component or Qt. And other Qt applications using the same Qt version (Qt 6.7.2 for tdesktop 5.2.3) should be affected just as well (but it could be a problem to get other applications using Qt 6.7.2 to test depending on the distro)

ilya-fedin commented 1 month ago

But I can't even confirm such a bug even exists yet, though.

ilya-fedin commented 1 month ago

What I mean is, this report will be closed either because no developers able to confirm or because it's not a tdesktop bug as clipboard is not tdesktop's area of responsibility so nothing could be done on it.

ilya-fedin commented 1 month ago

It also happens on tilix btw.

no, can't confirm with tilix either

cyberknight777 commented 1 month ago

Idk how else could I help reproduce this tbh.

cyberknight777 commented 1 month ago

Okay I have verified something.

It does not happen on v5.1.7. Whatever changed in tdesktop started happening since v5.1.8

cyberknight777 commented 1 month ago

@raorn can you confirm this?

sejtevgenij commented 1 month ago

Okay I have verified something.

It does not happen on v5.1.7. Whatever changed in tdesktop started happening since v5.1.8

Have checked the same and can confirm it.

Also I've tried different applications as copy source Telegram v5.2.3, Ubuntu 22.04 LTS, X11:

timatet commented 1 month ago

I observe the same behavior in Telegram Desktop 5.2.3. I use Ubuntu 20.04.6 LTS. It occurs when typing multi-line text with breaks as a single line before inserting it, e.g. in Notepad.

After pasting into the message input field in Telegram, each single line line break is replaced by three lines.

timatet commented 1 month ago

Same here, while copy-paste from terminal Telegram desktop 5.2.3, ubuntu 22.04, X.org

The developers probably corrected it in this commit 889ec0c731aea7e234fdf6e2648ef5edddad3c4d .

saterenko commented 1 month ago

The same issue in Telegram Desktop 5.2.3 on Ubuntu 20.04.1 LTS, and this appeared in the latest versions, it wasn't there before. I often have to copy from console to Telegram and this behavior is annoying...

john-preston commented 1 month ago

@saterenko In the latest 5.3.2 it should be fixed already.

saterenko commented 1 month ago

@john-preston Updated to version 5.3, no issue. Thanks a lot!