Slashdot Mirror


Dealing with the Unix Copy and Paste Paradigm?

MolecularBear asks: "I grew up on Windows machines, using the ol' ctrl-c to copy and ctrl-v to paste. For the past few years I've been a hardcore Linux user, running it almost exclusively at home and at work. As I am sure you are all aware, highlighting text in Linux automatically performs a copy while the middle mouse button performs a paste. The Ctrl-c, Ctrl-v standard works in many applications, but not all. Lately I have begun to find the automatic highlight-copy to be annoying. As in, I'll highlight text to copy it, then realize I want to highlight a block of text for the purpose of deleting it. Of course, the second highlighting overwrites the first highlighting. I am curious about how other people accomplish their copy/paste needs. Any special setups, applications, or words of wisdom?"

25 of 1,125 comments (clear)

  1. Common problem.. by SeanTobin · · Score: 5, Insightful

    ..but I don't have a solution either :)

    What annoys me the most is when copying/pasteing URL's. I'll highlight&copy a url somewhere then I go and paste it into firefox. Out of habbit I'll go and highlight the current URL and control+v what I assume I'm pasteing... and end up with the same URL that I started with.

    Whats more interesting is that sometimes what control+v pastes is different from what the middle-click pastes. I'm sure there is a reason, and I'm also sure its my fault for not knowing it... but its still annoying..

    What I've come to do is to copy a link via control+c or highlighting then opening a new tab in firefox. I have firefox to open new tabs to blank URL's and then I just middle click or control+v the URL.

    Its a partial and flawed solution to a small part of your problem. Of course, this is Slashdot ;)

    --
    Karma: SELECT `karma` FROM `users` WHERE `userid`=138474;
    1. Re:Common problem.. by GigsVT · · Score: 5, Informative

      Whats more interesting is that sometimes what control+v pastes is different from what the middle-click pastes.

      Yeah, there's basically two clipboards. The one when you just highlight something, and the one where you click "copy" in the menu.

      The confusion comes when bugs in some programs confuse the two (or only implement one of them .. cough xchat cough). It's extremely hard to convince egotistical programmers that their clipboard behaviour is actually wrong and confusing to users.

      --
      I've had enough abrasive sigs. Kittens are cute and fuzzy.
    2. Re:Common problem.. by ArmpitMan · · Score: 5, Insightful
      Does anyone else find the phrase "I'm sure there is a reason, and I'm also sure it's my fault for not knowing it" with respect to basic, everyday user interface tasks troubling?

      Because you really should.

    3. Re:Common problem.. by irix · · Score: 5, Informative

      Yeah, there's basically two clipboards.

      Yup. The best explanation I know of how this works from someone who would know :)

      --

      Do you even know anything about perl? -- AC Replying to Tom Christiansen post.
  2. Pasting urls by grahamsz · · Score: 5, Informative

    I usually find you can just pick up the url by selecting it, then middle button drop it into the browser. That seems to work on konq, netscape, mozilla and firefox on both linux and solaris.

    But i do feel your pain :)

    Firefox and Konqueror should have a button for "Open the clipboard in a new tab".

    1. Re:Pasting urls by Martin+Blank · · Score: 5, Informative

      Firefox and Konqueror should have a button for "Open the clipboard in a new tab".

      Agreed. While not a perfect solution, Clipboard Observer may be a possible way of dealing with this. It can get really intrusive, though, because it can end up opening tabs when you're copying a link to paste somewhere else, like in e-mail or IM. Worth a try, though.

      On an unrelated note, the same author also has Tabbrowser Extensions, basically some really, really, REALLY useful alterations to how Mozilla and Firefox handle tabs. With it, you can do things that should (IMHO) be in the codebase, like re-ordering tabs, moving tabs in groups, moving tabs between windows, opening duplicate tabs (complete with the tab's page history), and (my favorite) undoing the closing of a tab. I've been saved on a number of occasions by this last feature. Very handy. The author should be getting more recognition.

      --
      You can never go home again... but I guess you can shop there.
    2. Re:Pasting urls by AppyPappy · · Score: 5, Funny

      Using a mouse in unix? That's heresy.

      --

      If you aren't part of the solution, there is good money to be made prolonging the problem

    3. Re:Pasting urls by divirg · · Score: 5, Informative

      No, I'm thinking of Diggler.

      "Diggler is a small but powerful add-on for Mozilla, Netscape and Firefox. It adds a button next to the location bar which can clear the location bar..."

      Similar, but without the keystrokes.

    4. Re:Pasting urls by GMC-jimmy · · Score: 5, Insightful
      Which is simply a broken system. It's one of the things that definitely needs to be fixed before you can tryly say that Linux is ready for prime time.

      That depends on who you ask. I personally like and use both ways. Each can do things the other can not. For example X Windows method of copy/paste can work across different terminal sessions whereas KDE/GNOME's can not. On the other hand, KDE/GNOME's clipboard keeps a history whereas X or even bash does not. So depending on the environment you are in and the work you're doing. Both can be very useful at different times and for different needs. To think of both methods as one system is incorrect, they are most definitely two seperate systems. Being aware of that and making a decision on which to use will save you the frustration usually accompanied by confusing the two as a single system.
      --
      __________________________________
      Free your mind - Flush your toilet
    5. Re:Pasting urls by lerouxt · · Score: 5, Informative

      In KDE you can configure Klipper to either "Synchronize contents of the clipboard and the selection" or "Separate clipboard and selection".

      Your choice.

    6. Re:Pasting urls by Anonymous Coward · · Score: 5, Informative

      Option "AllowMouseOpenFail" "true" in your XF86Config. This is on by default on all linux distributions I've used recently, actually, so I'd be interested to know what distro you were using so it can be corrected.

  3. Minor solution - Ctrl-K by jmdjmd · · Score: 5, Informative

    Just a small shortcut - Ctrl-K will (should!) erase the rest of the line, no need for highlighting it. Works wonders for clearing the URL bar :-).

  4. This is a usability problem... by Anonymous Coward · · Score: 5, Interesting

    Whew, glad to see I'm not the only one .. the whole "click middle button to
    paste" thing drives me NUTS.

    I started computer life as a Mac user. I think one button is the simplest and
    most elegant way to design a mouse. I think mod-C and mod-V is the easiest way
    to cut & paste (one hand on keyboard, one on mouse). I also have big hands and
    fumbling fingers. I very often paste garbage into Mutt or other programs (for
    instance, extremely critical SSH sessions to production machines) in my
    Konsole windows. Hold breath, wait 2 seconds for the beeping to stop, paste
    text into another window and try to figure out if I just emailed porn to the
    client or sent /boot/kernel-2.4.25 to the printer.

    I even whipped out the soldering iron and replaced the Omron tactile switches
    in my trackball with the stiffest they had a digikey. It did help a little.

    And I also have dealt with the slight confusion that results after I highlight
    something, whip over to another window, and realize that I have to select
    everything to delete it first, which trashes the selection. Thankfully,
    Control-C/V works in the programs that I usually do this with.

    I bet most people don't even realize that X11 actually has more than one
    "clipboard". Did you? There is nothing in the interface that suggests I should
    have a mental model of multiple selection areas. Only after learning about
    Vim's keystrokes for accessing the various buffers did I realize what was
    going on.

    I just wish I could permanently and completely switch off this "feature" of
    X11, in all programs. I'm not stupid, I've been using X11 nearly daily since
    1990, and I've been screwing it up since then. Apparently just bringing this
    up in public is enough to condemn a person to flames, but there it is.

    Dear X11: please join the rest of the world and shed at least one of those
    buttons. Get rid of multiple clipboards or whatever you call them. I don't
    need it. My grandmother doesn't need it. Maybe some geeks have trained
    themselves to need it, let them figure out how to turn it back on.

    And while we're on the subject can we please standardize Control-C vs. ALT-C,
    etc.???

    (And yes I wrote this in a terminal and selected/pasted it with the button.. because Control-C doesn't work in the terminal!)

    1. Re:This is a usability problem... by zsau · · Score: 5, Insightful

      Yeah... I hate when I go to Windows and try to paste something only to discover it hasn't been copied. It's just what you're used to!

      --
      Look out!
  5. Middle button? by 1000101 · · Score: 5, Funny

    "... performs a copy while the middle mouse button performs a paste."

    I use a Mac you insensitive clod!

  6. Complain! by ChipMonk · · Score: 5, Interesting

    The best thing you can do is to complain to the developers at X.org, GNOME, and KDE (and whatever other desktop systems you know of). They need to hear this stuff, from many quarters, before they'll actually do anything about it. I think that X.org is probably the best place to start, given that development-oriented nature of the fork.

    As a slight correction, the copy-paste problem you describe isn't a Linux issue; it's an X Window System issue.

  7. -1 Redundant by stratjakt · · Score: 5, Informative

    It's always been broken.

    And any mention of a possible solution brings down the wrath of nerds who want to keep unix as unintuitive and awkward as possible.

    Besides the nuisance of what mouse click or keystroke you use to move text, it's not a clipboard like Windows uses, merely a text buffer.

    Ie; it's only good for text. You cant copy/paste (and by extension drag and drop) files, bitmaps, etc uniformly between apps.

    It's just another item in a laundry list of issues that are major to end users, but a low priority for hackers. Another speedbump on the road to Linux (unix) as a truly competitive desktop platform.

    --
    I don't need no instructions to know how to rock!!!!
  8. X copy/paste by Too+Much+Noise · · Score: 5, Informative
    Actually, there are 3 selections in X. How's that for confusing?

    The current consensus on freedesktop.org is something along the lines of:

    1. The primary selection is to be used for middle-click pasting.
    2. The secondary selection is unused now
    3. the clipboard selection is to be used for Windows-style copy/paste.


    The problem is that some apps use only the primary selection for all copy/paste operations, so it can get confusing.

    For more info, look here
  9. Re:"Correct?"-- A bit off topic, a bit flame-y by deebaine · · Score: 5, Insightful

    No offense, but this arrogance is exactly why Linux has insignificant desktop market share. Until the Linux community can get off its high horse ("This is the correct behavior??" Who says?), it will fail to attract users.

    Specifically, it will fail the "my mother" test: Why would my mother want to use this? As a disclaimer, let me point out that my mother has postgraduate education, has started a successful business, is a successful archaeologist, etc. We're not talking about a country bumpkin here. But she doesn't much like, or understand, computers. It took her long enough to figure out Ctrl-c Ctrl-v; she doesn't want to learn another behavior.

    The fact is that if Linux wants people to "adapt", then it needs to offer *evident* benefits beyond what Windows offers (again, subject to the my mother test; she doesn't care to recompile anything at all, ever). I might see enough benefit to tolerate some annoyance (I've never really noticed this as a big one, though I'll now be sure to count the times that I errantly cut/paste things), but she doesn't.

    -db

  10. the "universal standard" by XO · · Score: 5, Informative

    Is supposed to be the original Windows copy/cut/paste buttons:

    Copy: Ctrl-Insert
    Paste: Shift-Insert
    (I can't remember what Cut is, I never use it.. probably ctrl-delete)

    Then, sometime in the Win95 or Win98 era, Microsoft changed it to the less-intuitive and less-standard Ctrl-C, Ctrl-V.

    And Microsoft was a member of the body of people/organizations that made Ctrl-Insert and Shift-Insert the standard.. then went and trashed it...

    This is the CUA92 user interface universal standard, by the way.. and i'm a bit busy right now to do a google search for it, but I'm sure anyone interested could find it..

    --
    "Champagne for my real friends - and real pain for my sham friends!" http://ericblade.postalboard.com/
  11. Excellent article on the subject by toomim · · Score: 5, Informative
    You should read this article: http://www.jwz.org/doc/x-cut-and-paste.html.

    In a nutshell, there are TWO completely different clipboards implemented in X:

    1. The "select->middle click" clipboard
    2. And the "copy->paste" clipboard

    These two clipboards do not affect or interact with each other.

    Other OS's (like Windows) only have the second kind. Modern Unix applications (like anything based on GTK, QT, or Mozilla) support both clipboards simultaneously and independently.

    Old X Windows applications like XTerm only support the first kind. This is why you can't copy from or paste into an XTerm using C-c and C-v.

    So if you are using modern applications, you should always be able to use C-c and C-v. If you have to copy or paste something into an XTerm, you will have to select it and middle-click. The solution is to use a moderm terminal, like gnome-terminal, instead of XTerm.

    If you read the article, you'll learn that there are actually three different clipboards in X (one of which is never used), and that Emacs and XEmacs then implement yet another fourth clipboard!

    Also see the freedesktop.org reference.

  12. But wait... by gillbates · · Score: 5, Funny

    Wasn't this the very thing that open source was supposed to avoid?

    You don't like the copy and paste works? Fine - you've got the source code, so just change the key codes and recompile.... right?

    After a few frustrating hours of digging through source code, you finally find the keybindings. You change them, do a make.... and make crashes. So then you debug the make script and realize that you _ALSO_ need the source code to an obscure set of libraries. So you Google it, download the source, and it ALSO won't compile, because you've got the wrong compiler version.

    So you figure, what the heck, it's time to upgrade gcc anyway. You download the sources, compile it, only to find that you also need to download the sources for the shared libraries as well. Tomorrow, you'll resume.

    Well the weekend is coming up, and you've finally got the compiler and all its dependent sources together, and you start the compile. It actually compiles and installs just fine... And then you try to compile those obscure libraries and the compiler crashes. Turns out there's a kernel bug which means the new version of the compiler won't work with older kernels. You think, well heck, I'll just upgrade my kernel, and you ftp the sources.

    So you configure your kernel and then type 'make clean; make dep; make install' and kick off the process; it dies - once again, your compiler segfaults. So now you've got an older kernel with no way to compile the new one...

    So next weekend you decide that you're just going back to the old compiler. You rpm -i the compiler, and start the kernel compile process again... but the new kernel won't compile with the older compiler, and the newer compiler won't run on an older kernel....

    You take a walk. It's nice to see the sunshine, and feel the breeze for a change.

    It's tuesday and you've figured out that you can apply a few patches to your current compiler source, compile that, and then you'll be able to compile the most recent version of the compiler. So you do that. After you've built your intermediate version, you install it, build your kernel, and then recompile the newest compiler sources. After a reboot, you're able to successfully compile those obscure shared libraries, and rebuild your application.

    Then you fire up your modified ctrl-c, ctrl-v enhanced software....

    It segfaults. For no apparent reason.

    So you Google the newsgroups, and lo and behold, someone else is having the same problem! But they don't know what the problem is.

    Next week, your newsgroup buddy has found the problem. It turns out that a change in the way gcc handles memory allocation causes your obscure libraries to crash when compiled with the newer versions. They recommend using an older version of the compiler to build the software.

    So you go back to the intermediate version, recompile, and finally, everything works great. For a few days, you've been enjoying the benefits of ctrl-c ctrl-v copy and paste. Life is good.

    And then, you notice that KDE starts crashing at random for some unknown reason...

    --
    The society for a thought-free internet welcomes you.
  13. Re:Here is the way it SHOULD work. by marvinalone · · Score: 5, Funny

    You use emacs?

  14. Re:Pasting urls - use Ctrl-L in Mozilla by Peter+McC · · Score: 5, Informative

    In Mozilla and Firebird at least there is the very useful, but little-known shortcut Ctrl-L. This highlights the url bar but does *not* copy it to the clipboard. So when I'm in that situation I do Ctrl-L, delete, middle click.

    Of course, the middle-click on the page body works too, as long as you don't have to edit the URL. Ctrl-L is still super-handy if you want to type in an URL by hand or something.

    --
    You know what I hate? Wait, what do you like? I hate that!
  15. It's not a feature, it's a bug by GrouchoMarx · · Score: 5, Insightful

    As the parent and others have posted, X11 has TWO (well, three but no one uses the third) clipboards. One is highlight/middle-click, and one is Copy/Paste. The proper, documented (see parent and others) behavior is for both to be implemented and for both to operate completely and entirely independently of each other.

    In a properly implemented program, you should be able to use it as if there is no Primary Selection feature (highlight/middle-click) and not notice the difference from your usual Windows/Mac Ctrl+C/Ctrl+V habits. If you come across a program that does not do that, and mixes them together, that is not a feature that is a bug. Report it as a bug. If the developer dismisses it, report it as a bug again, email the developer telling him that you're going elsewhere, and switch to any of the plethora of other programs around (Free Software is great like that) that do things properly. Eventually someone will get the message.

    That's one reason why I stick to KDE applications whenever possible. All KDE applications (ie, ones provided by the KDE.org team) are well-behaved and non-buggy in this respect. Programs that misbehave should simply not be used. Period.

    --

    --GrouchoMarx
    Card-carrying member of the EFF, FSF, and ACLU. Are you?