Discussion:
Bug#588785: xterm: consider supporting freedesktop.org style clipboard behavior
Add Reply
Timo Juhani Lindfors
2010-07-12 09:40:02 UTC
Reply
Permalink
Package: xterm
Version: 261-1
Severity: wishlist

This is a wishlist bug. I was not able to locate upstream bug tracker
so I'm filing it here instead, please forward if appropriate.

I wish that xterm could be configured to support freedesktop.org style
clipboard behavior. For example I'd like to be able to do the
following:

1) select text using mouse
2) hit ctrl-shift-c
3) hit ctrl-shift-v

with the following expected results:

2) selected text is added to clipboard (not only primary selection)
3) contents of clipboard is sent as input to the application running
under xterm


I can implement step 3 with

XTerm*VT100.Translations: #override\n\
Shift Ctrl <KeyPress> v:insert-selection(CLIPBOARD)

in ~/.Xresources.

However, step 2 seems to be tricky to implement currently. I tried

XTerm*VT100.Translations: #override\n\
Shift Ctrl <KeyPress> v:insert-selection(CLIPBOARD)\n\
Shift<Btn1Down>:select-start()\n\
Shift<Btn1Motion>:select-extend()\n\
Shift<Btn1Up>:select-end(CLIPBOARD)\n

which is almost what I want. The problem is that it overwrites the
contents of clipboard too early, it should wait for me to press
ctrl-shift-c. Since it does not do this it is very easy to
accidentally destroy contents of clipboard by selecting some
text. Especially on a touchscreen it is very easy to accidentally
select text.

Would it be possible to add some sort of "copy contents of primary
selection to clipboard" command to xterm so that I could bind it to
ctrl-shift-c?


-- System Information:
Debian Release: squeeze/sid
APT prefers testing
APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.30-2-amd64 (SMP w/2 CPU cores)
Locale: LANG=C, LC_CTYPE=fi_FI (charmap=ISO-8859-1)
Shell: /bin/sh linked to /bin/dash

Versions of packages xterm depends on:
ii libc6 2.11.2-2 Embedded GNU C Library: Shared lib
ii libfontconfig1 2.8.0-2.1 generic font configuration library
ii libice6 2:1.0.6-1 X11 Inter-Client Exchange library
ii libncurses5 5.7+20100313-2 shared libraries for terminal hand
ii libutempter0 1.1.5-3 A privileged helper for utmp/wtmp
ii libx11-6 2:1.3.3-3 X11 client-side library
ii libxaw7 2:1.0.7-1 X11 Athena Widget library
ii libxft2 2.1.14-2 FreeType-based font drawing librar
ii libxmu6 2:1.0.5-1 X11 miscellaneous utility library
ii libxt6 1:1.0.7-1 X11 toolkit intrinsics library
ii xbitmaps 1.1.0-1 Base X bitmaps

Versions of packages xterm recommends:
ii x11-utils 7.5+4 X11 utilities
ii xutils 1:7.5+6 X Window System utility programs m

Versions of packages xterm suggests:
pn xfonts-cyrillic <none> (no description available)

-- no debconf information
--
To UNSUBSCRIBE, email to debian-bugs-dist-***@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@lists.debian.org
Thomas Dickey
2010-07-12 09:40:02 UTC
Reply
Permalink
Post by Timo Juhani Lindfors
Package: xterm
Version: 261-1
Severity: wishlist
...
Post by Timo Juhani Lindfors
Would it be possible to add some sort of "copy contents of primary
selection to clipboard" command to xterm so that I could bind it to
ctrl-shift-c?
It sounds possible to implement

(I'll add it to my to-do list, to investigate).
--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net
--
To UNSUBSCRIBE, email to debian-bugs-dist-***@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@lists.debian.org
Timo Juhani Lindfors
2011-02-10 22:40:02 UTC
Reply
Permalink
Hi,
Source: xterm
Source-Version: 268-1
We believe that the bug you reported is fixed in the latest version of
I tested http://incoming.debian.org/xterm_268-1_amd64.deb but the step
3 in http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=588785#103 still
fails. Was this bug closed accidentally or do I need something else in
~/.Xresources?

[For reference the comment #103 is:

From: Timo Juhani Lindfors <***@iki.fi>
To: Thomas Dickey <***@his.com>
Cc: ***@bugs.debian.org
Subject: Re: Bug#588785: ANN: xterm patch #267
Date: Mon, 22 Nov 2010 14:43:39 +0200
The problem is the "ignore". I didn't modify the mouse-button
translations. It would be nice to just have the selection stop
when copy-selection happens, but it didn't appear necessary.
thanks. Next I tried just

XTerm*VT100.Translations: #override \n\
Shift Ctrl <KeyPress> v:insert-selection(CLIPBOARD)\n\
Shift Ctrl <KeyPress> c:copy-selection(CLIPBOARD)\n

and then

1) select text
2) hit ctrl-shift-c without moving mouse
3) move the mouse and click somewhere so that no text is selected anymore

first copied the text to clipboard (step 2) but then deleted the
clipboard contents in step 3. Any idea why?

]
--
To UNSUBSCRIBE, email to debian-bugs-dist-***@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@lists.debian.org
Thomas Dickey
2011-02-12 14:00:02 UTC
Reply
Permalink
Post by Timo Juhani Lindfors
Hi,
Source: xterm
Source-Version: 268-1
We believe that the bug you reported is fixed in the latest version of
I tested http://incoming.debian.org/xterm_268-1_amd64.deb but the step
3 in http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=588785#103 still
fails. Was this bug closed accidentally or do I need something else in
~/.Xresources?
well, I did respond, in comment #108. Clicking with the mouse cleared
the selection because that triggers the start-select action.
--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net
--
To UNSUBSCRIBE, email to debian-bugs-dist-***@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@lists.debian.org
Thomas Dickey
2011-02-12 15:00:02 UTC
Reply
Permalink
Post by Thomas Dickey
well, I did respond, in comment #108. Clicking with the mouse cleared
the selection because that triggers the start-select action.
Hmm yes, I remember you said that xterm "could be modified to _not_
clear its selection until something like a select-end or
copy-selection asked for the selection data." but does xterm 268-1
actually do that?
no - I was commenting that it might be possible, but that was to suggest
further discussion on how that feature might be designed.
--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net
--
To UNSUBSCRIBE, email to debian-bugs-dist-***@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@lists.debian.org
Timo Juhani Lindfors
2011-02-16 07:50:02 UTC
Reply
Permalink
Post by Thomas Dickey
no - I was commenting that it might be possible, but that was to
suggest further discussion on how that feature might be designed.
Aha ok. I managed to forget most of the details by now :-) I'm really
not familiar with X protocol details so I'm afraid I can't help much
with the design. However, I'm happy to test patches and give feedback on
whether they give a sufficiently "freedesktop.org style" clipboard
behavior :-)
--
To UNSUBSCRIBE, email to debian-bugs-dist-***@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@lists.debian.org
Timo Juhani Lindfors
2011-02-12 15:00:02 UTC
Reply
Permalink
Post by Thomas Dickey
well, I did respond, in comment #108. Clicking with the mouse cleared
the selection because that triggers the start-select action.
Hmm yes, I remember you said that xterm "could be modified to _not_
clear its selection until something like a select-end or
copy-selection asked for the selection data." but does xterm 268-1
actually do that?
--
To UNSUBSCRIBE, email to debian-bugs-dist-***@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact ***@lists.debian.org
Thomas Dickey
2020-01-14 00:40:02 UTC
Reply
Permalink
I made the indicated change to the manual in patch #328:

Patch #328 - 2017/06/01
add examples of translations resource for select/paste, and for
font-size changes to the manual.
--
Thomas E. Dickey <***@invisible-island.net>
https://invisible-island.net
ftp://ftp.invisible-island.net
Loading...