Ticket #3083 (new enhancement)

Opened 11 years ago

Last modified 10 years ago

Elaborate/make user-friedly mcedit X11 Copy/Paste support

Reported by: pfalcon Owned by:
Priority: major Milestone: Future Releases
Component: mcedit Version: master
Keywords: Cc: oswald.buddenhagen@…
Blocked By: Blocking:
Branch state: no branch Votes for changeset:


Support for X11 clipboard Copy/Paste? was implemented in #30, but that implementation suffer typical "last mile problem": while everything to support feature is there, it's not enabled by default (and it's not easy to enable it by default for downstream packages). Then, it's fairly basic feature, so users expect it to work out of the box, or assume it's not available at all (example: user expects colors to work OOB, and it's indeed how it is now (there were dark ages when b&w was default), user expects mouse to work OOB, and indeed, it's such in default source builds and packages supplied by distro). So, such situation leads to reports like #3081.

So, let's consider current implementation.

  1. It depends on availability of "xclip" external tool. I found that it's not installed on my Ubuntu system which is in use for 1.5+ years (i.e. I neither installed it explicitly, nor it was pulled as dependency for lots of software I installed over this time). I'd expect such small and basic utility to be part of default X install, alas, it's not.
  2. Allow to use external tool to handle clipboard copy/paste is actually cool extra feature. It can be used to implement networked clipboard, or work around charset problems (see #30 comments), etc, etc. But then its application should not depend on DISPLAY envvar set (see https://www.midnight-commander.org/ticket/30#comment:33 for reference), or that hardcodes its usage to X session only.
  3. From 1, relying on xclip leads for the feature not working of the box. mc now includes some X integration and thus dependency, so it should be possible to include clipboard handling code to mcedit itself.

Thus, proposed changes are:

  1. Remove DISPLAY var check.
  2. If clipboard_store/clipboard_paste ini vars are set, execute corresponding commands.
  3. Otherwise, use builtin copy/paste implementation.

Comments on such proposal are welcome.

Change History

comment:1 Changed 11 years ago by pfalcon

  • Milestone Future Releases deleted

comment:2 Changed 11 years ago by pfalcon

  • Milestone set to Future Releases

comment:3 Changed 10 years ago by ossi

  • Cc oswald.buddenhagen@… added

+1 - as i noted in the original issue, the amount of code needed for this is ridiculously small, given that we already have an X connection open.

fwiw, the current behavior to have a configurable command which has a hard-coded condition doesn't even make any sense ... you could hard-code the command itself just as well.

Note: See TracTickets for help on using tickets.