#1149183 xrdp: Double line spacing with clipboard paste to xterm

Package:
xrdp
Source:
xrdp
Description:
Remote Desktop Protocol (RDP) server
Submitter:
Walter Eaves
Date:
2026-09-27 21:59:02 UTC
Severity:
normal
#1149183#5
Date:
2026-09-27 21:57:03 UTC
From:
To:
Dear Maintainer,

I'm using xrdp on a ChromeBook, not Windows. I use the penguin Linux container on the ChromeBook
to run xfreerdp3 and I then work within a remote XFCE4 desktop and most
of my work is very text-based. I have found that when I use xterm (or uxterm), with VT100
translations to insert-selection(CLIPBOARD) into the XTerm, I get double lines.

I'm not alone. Other people have recorded this problem. Here is such a entry

http://superuser.com/questions/1156974/double-new-line-when-copy-to-konsole-on-xrdp/1940620#1940620

I contributed to this thread as Bonaparte. (The solution that satisfied the poster "stty -icrnl" is a red-herring. He is pasting into vim which recognizes carriage return as a new-line.)

Because XRDP was written for Windows clients, it converts Unix line-endings \n to Windows \r\n.
But if you are pasting to another Unix application, via a tty, then tty converts \r to \n
and the windows \r\n and becomes \n\n - and you get the double lines.
If you use the stty -icrnl trick then you get double ^M^M (ie. \r\r) instead of \n\n.

As I mention in the post at superuser, you don't get double line spacing if you use the
X11 middle button paste method.

Here are my VT100 translations:

UXTerm*VT100.cutNewline: false
UXTerm*VT100.cutToBeginningOfLine: true

UXTerm*selectToClipboard: false

UXTerm*VT100.translations: #override \n\
 Ctrl <Key>Insert: copy-selection(CLIPBOARD) \n\
 Shift <Key>Insert: insert-selection(CLIPBOARD) \n\

So I make a listing: ls -1

Downloads
etc
lib
local
Music
notes.txt
Pictures
profile~
Public
share
src
super.sh
Templates

And then I copy it with Ctrl-Ins and paste it in od -c

lib

local

Music

notes.txt

Pictures

profile~

Public

share

src

super.sh

Templates

0000000   D   o   w   n   l   o   a   d   s  \n  \n   e   t   c  \n  \n
0000020   l   i   b  \n  \n   l   o   c   a   l  \n  \n   M   u   s   i

Double lines because \n was converted \r\n and tty converts those to \n\n

If I look at xclip -o

etc
lib
local
Music
notes.txt
Pictures
profile~
Public
share
src
super.sh
(B1-root)weaves@beatrice:~$ xclip -o | od -c
0000000   e   t   c  \n   l   i   b  \n   l   o   c   a   l  \n   M   u
0000020   s   i   c  \n   n   o   t   e   s   .   t   x   t  \n   P   i
0000040   c   t   u   r   e   s  \n   p   r   o   f   i   l   e   ~  \n
0000060   P   u   b   l   i   c  \n   s   h   a   r   e  \n   s   r   c
0000100  \n   s   u   p   e   r   .   s   h  \n
0000112

So no double lines.

If I use the stty -icrnl

Documents
Downloads
etc
lib
local
Music
notes.txt
Pictures
profile~
Public
share
src
super.sh
Templates
thinclient_drives
tmp
t.txt
Videos
(B1-root)weaves@beatrice:~$ stty -icrnl
(B1-root)weaves@beatrice:~$ od -c
Documents^M^MDownloads^M^Metc^M^Mlib^M^Mlocal^M^MMusic^M^Mnotes.txt^M^MPictures^M^Mprofile~^M^MPublic^M^M^M^C
(B1-root)weaves@beatrice:~$

But if use mouse select and middle button insert

~$ od -c
Desktop
Documents
Downloads
etc
lib
local
Music
0000000   D   e   s   k   t   o   p  \n   D   o   c   u   m   e   n   t
0000020   s  \n   D   o   w   n   l   o   a   d   s  \n   e   t   c  \n
0000040   l   i   b  \n   l   o   c   a   l  \n   M   u   s   i   c  \n

That works.

I also mention in the post at super-user that other Terminal Emulators (GNOME Terminal, XFCE4 Terminal) they work because they use libvte and not tty to do their translation.

If I kill the xrdp-chansrv process on the host running XRDP which supports the xterm, then
it also works, but I can't copy or paste from the ChromeBook that is running xfreerdp3.

Unfortunately for me, I can't switch over to using the libvte terminal applications.

Would the upstream developers be able to add an extra configuration setting for sesman.ini?
  ClipBoard.LineEndings = u2d | u2u
with u2d as the default? And u2u would do nothing but leave the existing line-endings unchanged

Thanks!

Wonderful application, it's my only first choice remote session tool now.