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?"

72 of 1,125 comments (clear)

  1. 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 divirg · · Score: 3, Informative

      There's a plugin for Firefox that puts a button next to the URL field to clear it when you're about to paste. Don't remember what it's called - check the Firefox plugins page on mozilla.org.

      Doesn't help the general problem though...

    2. 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.
    3. Re:Pasting urls by connsmythe96 · · Score: 4, Informative

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

      Try middle-clicking in the main view area of mozilla/firefox with a URL in the clipboard... ;)

      --
      if(!cool) exit(-1);
    4. Re:Pasting urls by taniwha · · Score: 4, Informative

      Konq at least attempts to solve this by having a delete button next to the URL - clicking that black thing with an X on it while 'holding' text from a hilite clears the URL so you can drop a new one in there

    5. 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.

    6. Re:Pasting urls by GMC-jimmy · · Score: 3, Informative

      X Windows, like bash, has it's own way of copy/paste (ie: highlight/middle-click) and KDE/GNOME have their own way of copy/paste (ie: ctrl+c/ctrl+v). What that means is while you're running X with a popular desktop suite like KDE or GNOME, you have more than one clipboard. As you propbably wouldn't use multiple text editors to simultaneously edit the same file, you shouldn't try to use multiple clipboard copy&paste functions for the same task.

      --
      __________________________________
      Free your mind - Flush your toilet
    7. Re:Pasting urls by ronlusk · · Score: 4, Informative
      I've created a script for working with KDE's klipper clipboard tool.
      # point at the browser
      $FIREFOX=/opt/mozilla/firefox/firefox
      ($FIREFOX -remote "ping()" && \
      $FIREFOX -remote "openUrl($1,new-tab)") || \
      $FIREFOX $1 &
      I'm not sure I have everything the best it can be. But when I select a URL somewhere, klipper pops up a menu offering to open it in Konqueror, Mozilla, or Firefox (among other things). I have configured klipper so pressing "F" is a shortcut for opening in Firefox, where it opens it in a new tab.
    8. Re:Pasting urls by AntiOrganic · · Score: 3, Informative
      On an unrelated note, the same author also has Tabbrowser Extensions [sakura.ne.jp], 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.


      Unfortunately, it's so bug-ridden and terrible that Firefox developers won't accept bug reports from people who have it installed.
    9. Re:Pasting urls by fishbot · · Score: 2, Informative

      Not quite. There are windowmanagers out there designed to be exclusively used with the keyboard (ratpoison for one, evilwm for another). X itself is input device agnostic. The window managers assume to much.

    10. Re:Pasting urls by BinLadenMyHero · · Score: 2, Informative

      I prefer Digger.

      Also note that you can, within Firefox, drag a link or a selected URL text to the tab bar to open it. If you drag to an existing tab it will replace that tab, and on an empty area (or the X button, if the bar is full) of the tab bar it will open a new tab.

    11. 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.

    12. Re:Pasting urls by Watts+Martin · · Score: 2, Informative

      I admit it's been a while since I used X regularly, but as I recall, you often didn't have a choice of which system to use -- many programs only responded to one or the other. This is what can be irksome. I distinctly remember some combination I had when I was running under XFce where I couldn't move a URL from the terminal window to Mozilla, period. Each of them knew about their own clipboard style, and that was it.

      I admit I'm not sure what you mean when you say that the X windows system can "work across different terminal sessions whereas KDE/GNOME's cannot." If you simply had one unified clipboard, wouldn't this still be the case (if it was done correctly?) That's the way it works in OS X. This sounds like a problem with KDE/GNOME's implementation, unless I'm misunderstanding you.

    13. 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.

    14. Re:Pasting urls by Wyzard · · Score: 2, Informative

      You can paste between terminal sessions using GNOME's clipboard mechanism -- you just have to use different hotkeys (in gnome-terminal it's ctrl-shift-C to copy) since the usual ones need to be passed through to the shell (ctrl-C to abort a job, for example).

    15. Re:Pasting urls by phoenix.bam! · · Score: 4, Informative

      You don't need mouse gestures, all you need to do is highlight a URL, and paste it into the MAIN WINDOW of the FireFox browser, NOT THE URL BAR, and it will load that website.

    16. Re:Pasting urls by crossconnects · · Score: 2, Informative

      Easy.

      redirect the output to a file.

      switch to the other terminal

      read back from the file. use grep if necessary.

      --
      no big sig
    17. Re:Pasting urls by vikool · · Score: 2, Informative
    18. Re:Pasting urls by Fancia · · Score: 3, Informative

      But it also offers a "Light" mode with only the more commonly-used features turned on, which makes it much faster and less buggy.

      --

      Bít, zabít, jen proto, ze su liska!
    19. Re:Pasting urls by jargoone · · Score: 2, Informative

      I don't know if you're being a smart ass, but I'll assume you're not so I actually help you if that's the case. I wasn't just being pedantic when I said bash itself doesn't have copy and paste. It's a combination of the window manager and the terminal program.

      It just so happens that most Linux distributions that I've seen come with a console-mode copy and paste program called "gpm". Look at the output of "ps" and see if it's running. If not, start it. Once it's running, switch to a virtual console and move your mouse and you should see a cursor floating around.

    20. Re:Pasting urls by ader · · Score: 2, Informative

      On Mozilla, Multizilla provides a similar button next to the URL bar. (Plug: it's a great extension, almost like having a new browser.)

      Ade_
      /

      --
      Big Bubbles (no troubles) - what sucks, who sucks and you suck
    21. Re:Pasting urls by gowen · · Score: 2, Informative

      Me too. Fortunately, you can turn it off.

      Go to about:config and set the value of middlemouse.contentLoadURL to false

      I felt a whole lot better afterwards.

      --
      Athletic Scholarships to universities make as much sense as academic scholarships to sports teams.
  2. 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 :-).

    1. Re:Minor solution - Ctrl-K by Xzzy · · Score: 3, Informative

      control-u blasts all of it. I know I've seen this convention somewhere I just can't place it. ;)

      Many of the bash control sequences do the same thing in web browsers. In most text editing situations, really.

  3. 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.
  4. Oh boy by John+Starks · · Score: 3, Informative

    Soon Slashdot will be filled with the waring camps of "X is perfection" and "X is old, so it is bad."

    In this case, I find that it's merely a matter of getting used to the way the X clipboard functions. For example, delete the old text AFTER you paste the new text. It's a different way of managing your clipboard, but it's not necessary any better; for most jobs, I find it to be MORE convenient, and I start to forget to Ctrl-C when I'm in Windows.

    For more information on how X handles the clipboard/selection, see Jamie Zawinski's informative web page.

  5. -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!!!!
  6. KDE klipper... by rsidd · · Score: 4, Informative
    has a menu of recently selected highlighted items. There should be a dock in the "system tray" panel item, looks like a clipboard with the "k" letter. Clicking on it has a history of recently copied (ie highlighted-with-mouse) items, you can select what you like to bring it to the top, then middle-button will paste that next time.

    Or else, first paste what you want to insert, then delete what you want to remove...

  7. Re:Common problem.. by nachoman · · Score: 3, Informative

    The difference between the select/middle-click paste and the Control-C/Control-V paste is because they each use different Clipboards. For instance if you are using KDE, The Control-C will copy to the KDE clipboard and the select with mouse will copy to the X-Windows clipboard.

    I think the reason for the two different Clipboards is because the KDE (Or gnome? Not sure if it works the same way) clipboard handles copying content other than plain text and the X-Windows one not.

  8. Re:Your proiblem... by Psiren · · Score: 3, Informative

    You can just click the middle button anywhere on the page. It'll do a paste of the buffer and load the url in it. You don't have to paste it into the url bar. Once you've done it a few times it makes life a lot easier. It's a far larger target to paste into. Just be careful not to click when you're hovering over a link.

  9. Re:Common problem.. by Klerck · · Score: 2, Informative

    You can press ctrl+l in firefox and it will take you to the address bar while simultaneously highlighting it. Since you didn't manually highlight it, it doesn't copy into the paste buffer, and you're free to paste the other URL you had in the buffer into the address bar.

  10. no solution to a non-problem by Ender+Ryan · · Score: 2, Informative
    I don't get it, what is the problem? X has two copy/paste buffers. One is used with highlight/middle mouse button, the other is like Windows, except the keybindings are specific to the app/toolkit. Generally, all new apps use control+c and control+v, just like Windows. Sans vim, I haven't used an app that uses anything other than control+c/v in years.

    So what is the problem? Are the apps you use broken?

    --
    Sticking feathers up your butt does not make you a chicken - Tyler Durden
  11. Clipboard Program by Greyfox · · Score: 2, Informative
    xclipboard helps a little bit. It'll buffer copies and pastes and let you select between them. I use it when the copy/paste behavior really starts to piss me off. It's helpful with emacs too.

    The problem is X leaves copy/paste (and pretty much everything else) up to the application, and every application does it differently. Ideally one day we will all settle on a widget toolkit that enforces a standard copy/paste behavior. I'm not holding my breath though.

    --

    I'm trying to teach myself to set people on fire with my mind... Is it hot in here?

  12. Re:What middle button? by GigsVT · · Score: 2, Informative

    If highlight clobbers something you copied with ctrl-c, then it's a bug in the program.

    There are two clipboards, and highlighting should never clobber something you manually copied.

    --
    I've had enough abrasive sigs. Kittens are cute and fuzzy.
  13. Word of wisdom: emacs by smittyoneeach · · Score: 2, Informative

    The more you use it, the more you use it.
    Out of the box, it might not do much of anything you want, but few problems you can envision haven't been solved.
    Only thing I haven't seen yet is a PalmOS version, so I can run it on my Kyocera7135. Got one of those external keyboards; but, hey, that's motivation to figure out how to configure a GCC cross-compiler and add something to the emacs canon.
    Other than PalmOS, emacs is OS and window-manager (if any) agnostic, and comes with a ridiculous menu of existing tools.
    Go, emacs.

    --
    Get thee glass eyes, and, like a scurvy politician, seem to see things thou dost not.--King Lear
  14. Re:What middle button? by roca · · Score: 4, Informative

    Only if your application sucks. freedesktop.org spells out how this should work; ctrl-c/ctrl-v manage the CLIPBOARD selection, and mouse selection manages the PRIMARY selection. Selecting text with the mouse should NOT interfere with ctrl-c ctrl-v operations in ANY way.

    http://freedesktop.org/Standards/clipboards-spec /c lipboards.txt

  15. 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
    1. Re:X copy/paste by Too+Much+Noise · · Score: 2, Informative
      if you follow the link, you'll see they say:
      explicit cut/copy commands (i.e. menu items, toolbar buttons) should always set CLIPBOARD to the currently-selected data (i.e. conceptually copy PRIMARY to CLIPBOARD)
    2. Re:X copy/paste by Carewolf · · Score: 2, Informative

      Actually the problem is easierly solved using the clipboard. Just press CTRL+C, then select and delete and press CTRL+V. If implemented correctly the selection has not overriden the clipboard.

  16. Re:Common problem.. by Apro+im · · Score: 2, Informative

    In GNOME, at least, i think there's a separate clipboard that's for Ctrl+C and Ctrl+V, so if you use those two, you can use normal windows-styl C&P

  17. Everyone has it wrong all the time by tesmako · · Score: 2, Informative
    For some reason people seem to constantly miss how the X clipboard and selection mechanism works. So here we go again:

    The X clipboard work exactly like the Windows and Mac ones. When you chose 'copy' on an edit menu or similar (ctrl+c in a lot of toolkits) the application will claim ownership of the clipboard and copy the text to some internal buffer. When an application gets a paste in some way (edit->paste or ctrl+v perhaps) it will request the text from the clipboard owner.

    There is ALSO the selection mechanism. Whenever you select text in an application it will claim ownership of the primary selection, whenever an application receives a middle mouse click it will request the primary selection from the registered application.

    These two mechanisms are orhogonal and should in no way interfere with each other in a correctly written application. Hope this clears things up. See JWZ's small guide to the topic for more information.

  18. I don't know what software you all are using... by sab39 · · Score: 4, Informative

    In every program I use in Linux (specifically, Mozilla, rdesktop, and various GNOME stuff) Ctrl-C/Ctrl-V work perfectly, and so does the select/middleclick system, and neither interferes with each other.

    I haven't used KDE in a long time but I understand that they introduced the same behavior with Qt3/KDE3.

    Unless you're using really ancient software, pretty much everything will work in *either* mode, or you can do what I do and use a combination of both (choosing whether to bother pressing Ctrl-C to copy depending on whether you're going to need to highlight something at the destination).

    I'm really curious to understand how so many people manage to still have a problem with this. Are you perhaps expecting that since "everybody knows that select copies on Linux", Ctrl-V will paste the thing that you last selected, instead of the last thing you Ctrl-C'd, and not testing it to verify this? Or just assuming that selecting something will overwrite your Ctrl-C buffer? I'd like to believe that people would actually test these things before posting Ask Slashdots about it, but you have to wonder...

  19. Re:Another Annoying Linux-Ism by aldousd666 · · Score: 2, Informative
    That's easy enough to fix. In your .rc file (or .login file) on the target host, set the terminal type to whatever you're used to. vt100 or ansi seem to work ok, but stick to one and you don't have to keep switching. I use tcsh, so in my .tcshrc file on each host, I have two lines that say

    setenv TERM ansi
    tset

    then I always use the ansi terminal settings (i.e. backspace not Ctrl-H)
    --
    Speak for yourself.
  20. you are wrong by Ender+Ryan · · Score: 2, Informative
    1. There is no such thing as "X Windows"

    There are tons of SDKs for X-Windows, almost all of them using a separate clipboard implementation/mechanism.

    2. The above is completely false. X has a primary and secondary copy/paste buffer. It always works the same way, the only real caveat being that apps can use different key combos to control the primary buffer. I haven't used an app in years that used anything other than control+c/v for the primary buffer.

    --
    Sticking feathers up your butt does not make you a chicken - Tyler Durden
  21. Re:I prefer the X way, kind of... by gorre · · Score: 2, Informative

    But I do know what you're talking about. I mostly run into this issue when entering text into the address bar of Mozilla. Fortunately, Mozilla uses emacs-style keybindings, so if I want to replace what's in the address bar with what's on the clipboard, I just:

    Wow, stop there! That sounds way too complicated. You do know that in Mozilla (as with Mozilla Firefox) you can just middle click anywhere on the current page and the browser will go to what's in the clipboard (or search Google with "I'm feeling lucky" if it's not a URL). Simplicity :).

    --
    "Madness is something rare in individuals - but in groups, parties, peoples, ages it is the rule." -- Nietzsche
  22. Re:Common problem.. by forevermore · · Score: 4, Informative

    Don't forget that shift-insert is almost always used to paste the X clipboard (as opposed to the ctrl-c/ctrl-v one managed by the desktop environment). But then some programs (gecko browsers being the most annoying for me) go and alias this to the functionality of ctrl-v, so I have no keyboard equivalent for middle-click paste.

    --
    Do you really need reason for beer? Wingman Brewers
  23. Re:Common problem.. by RossyB · · Score: 4, Informative

    Urr, all wrong.

    Control-C/V will copy/paste the CLIPBOARD selection. Highlight/middle click will copy/paste the PRIMARY selection. No real applications use the SECONDAY selection, but it still exists.

    There is no difference between any of these clipboards, GNOME and KDE don't have their own clipboards (though KDE does have a daemon to collect copied data so that it persists after the application closes), and all X clipboards can handle any content type: it's the applications which don't support it.

    http://freedesktop.org/Standards/ClipboardsWiki is an excellent summary of the X clipboard.

  24. 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/
    1. Re:the "universal standard" by LenE · · Score: 4, Informative

      Unfortunately, Ctrl-Insert and Sift-Insert were never the standard method in Windows, because Microsoft never really standardized anything. These were WordPerfect methods.

      The first standardization, well before 1992, was the Macintosh Human Interface Guidelines published in Inside Macintosh around 1983-84. This is the origin of the Ctrl-C and Ctrl-V.

      Apple did lots of usability studies for the Mac, and the fruits of this labor were the one-button mouse and the Command-z,x,c & v, as well as other standardized "Command Key Shortcuts."

      This cluster of keys were selected because of their proximity to the Command key, and the ease of pressing them with the left thumb and index finger. Z, X, C, and V corresponded to Undo, Cut, Copy, and Paste, the most common operations that were required in a GUI-based work system. Others combinations were standardized for closing windows (Cmd-w), Saving (Cmd-s), Printing (Cmd-p), and Quitting programs (Cmd-q). All Mac programs had to include these functions and use these standardized shortcuts if applicable.

      Sun used these same Command Key Shortcuts in OpenLook, and eventually Microsoft embraced and corrupted these combinations by replacing the Command key with the Control Key, which required using the left pinky finger instead of the thumb to press. The Alt key which is positioned in the same place as the Command key was already claimed in Windows for their pseudo-standard of activating menus based on the underlined letter. The Command Key Shortcuts outside of this cluster were partially implemented for printing and saving, but quitting programs or closing windows is still the archaic and unintuitive Alt-F4 on Windows.

      -- Len

  25. Re:Common problem.. by psoriac · · Score: 2, Informative

    This annoyed the hell out of me too, until I realized that ctrl-L will highlight the current url *without* overwriting your other highlighted text. Then hit delete or backspace to clear the url bar, and middle-click to paste in the new url.

    At least, Mozilla on FreeBSD in X with WindowMaker does this. I can't claim it works on any other combo, which in itself is a discussion for another day.

    --
    I browse Slashdot at +3, Funny
  26. bash can use either emacs or vi ctrl keys by zapp · · Score: 2, Informative

    Actually that's an Emacs control sequence.

    Bash uses emacs control sequences by default, but can easily be set with either of 2 ways...

    1. set environment variable EDITOR=vi
    2. at prompt, type: set -o vi

    then bash will act just like vi

    --
    no comment
    1. Re:bash can use either emacs or vi ctrl keys by Prowl · · Score: 2, Informative

      i could be wrong but i belive those sequence are readline(3), which is used by emacs/bash etc

      --
      That man tried to kill mah Daddy
  27. Re:What middle button? by Anonymous Coward · · Score: 1, Informative

    You do know that CTRL+C is used to interrupt programs.. right?

  28. 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.
  29. Yes, there *IS* a common clipboard standard! by smcv · · Score: 4, Informative

    Yes, there is a common clipboard mechanism. Once you understand that there are two separate clipboards (and that this is a feature), everything makes sense.

    Here's how it behaves in modern X environments like KDE 3, GNOME, XFCE, etc.:

    - There is a clipboard (called CLIPBOARD in the specs), which you interact with by explicit copy and paste commands, for which the key bindings are conventionally Ctrl+C, Ctrl+V, Ctrl+X to copy, paste and cut respectively. Use it whenever you would use the Windows or Mac OS clipboard, teach it to new users, and so on.

    - As an extra "easter egg", applications can manipulate the selection (the currently highlighted text) using the same API. The convention is to select text by dragging (or Shift+cursor keys, etc.) and to copy the selection from another program by pressing the middle mouse button. I will reassert: this is an "easter egg" for advanced users. The specs call this the "primary selection", PRIMARY (there is also a SECONDARY, but I am not aware of any program that uses it).

    As documented here:
    http://www.jwz.org/doc/x-cut-and-paste.html
    http://pdx.freedesktop.org/Standards/clipboards- sp ec/clipboards.txt

    OK, now the holes in that logical explanation:

    - KDE 2 used to use Ctrl+C, Ctrl+V to manipulate PRIMARY. This was wrong and had all the flaws the poster cites. Solution: Upgrade to KDE 3, problem solved.

    - Some other broken apps do the same. Solution: either fix them as you suggest, or stop using them. GNU Emacs 20 was apparently broken in the same way as KDE 2, while XEmacs and GNU Emacs 21 apparently work in the same way as KDE 3 (I can't confirm this, I use vim myself).

    - Some (usually older) apps (like xterm) don't have copy or paste commands at all, but do have the selection/middle-click behaviour. Solution: either use something else (e.g. Konsole if you're a KDE fan) or learn the middle-click behaviour too. Since the command line is generally considered to be "hard", it shouldn't be that much of an intellectual leap.

    - Ctrl+C already means something very common and specific (send a SIGINT) in console windows, so the standard Windows-style keybindings cannot be used in console windows. This is a historical clash between the Unix/DOS "Ctrl+C interrupts" and the Windows/OS2 "Ctrl+C copies" (on the Mac the convention is actually Command-C, so Ctrl is still available, and OS X's Terminal uses it as you'd expect) - Windows' MS-DOS-derived command prompt has the same conflict and a similar solution.

  30. 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.

  31. You didn't grew up for long... by lfourrier · · Score: 2, Informative
    I grew up on Windows machines, using the ol' ctrl-c to copy and ctrl-v to paste.

    Those are not old. Those are a copy of Cmd-C Cmd-V from the Mac.

    The original old shortcuts for Microsoft Windows are Ctrl+Ins and Shift+Ins. And when I'm on a Microsoft Windows station, my fingers are doing them without me thinking. But alas, less and less application support them, nowadays.

    If Microsoft managed to change, in the course of a few years, such a fundamental characteristic of the UI, why X could not ?

  32. Re:Common problem.. by DeadInSpace · · Score: 3, Informative
    I think the reason for the two different Clipboards is because the KDE (Or gnome? Not sure if it works the same way) clipboard handles copying content other than plain text and the X-Windows one not.
    Wrong. X' selections mechanism (which is a general data sharing mechanism that's also used for copy/paste) supports any kind of data, not just text. It's the widgetsets and/or applications that don't understand anything other than text. Luckily, this is improving as GTK and QT are working on this.

    From the ICCCM, section 2.6.2 (referring to data transferred through selections):
    The atom that a requestor supplies as the target of a ConvertSelection request determines the form of the data supplied. The set of such atoms is extensible, but a generally accepted base set of target atoms is needed. As a starting point for this, the following table contains those that have been suggested so far.
    From a document explaining X selections:
    One of the really cool, yet rarely used, features of the selection mechanism is that it can negotiate what data formats to use. It's not just about text. When one application asks another for the selection, part of their communication involves the requester asking the owner for the list of types in which they are capable of delivering the selection data; then the requester picks the format they like best, and asks for it that way.
    By the way, "X-Windows" doesn't exist, it's the "X Window System", or "X" for short.
  33. Re:If only Linux would get copy-paste right.. by Christianfreak · · Score: 2, Informative

    X can copy content and it has multiple clipboards, the problem is that everyone has done the implementation the wrong way. (See the links folks have posted above)

    Gnome seems to be able to copy an paste files just fine, and I'm sure KDE can too. I use Blackbox and I can drag images off the web from Firefox to GIMP and they open (oddly enough if I drag from Firefox to Nautilis they save only the URL, probably a bug in Nautilus)

  34. You've got it all wrong by Rysc · · Score: 2, Informative

    This is a common mistake. In reality:

    Highlighting text puts it into the X selection buffer.
    Middle clicking pastes the X selection buffer.
    CTRL+C (or whatever copy is set to) puts text onto the X clipboard.
    CTRL+V (or whatever) pastes the X clipboard.

    Notice: THERE ARE TWO BUFFERS. The X selection buffer and the X clipboard buffer. If your app overwrites the clipboard on highlight then it s misbehaving (see fd.o for what is "right").

    Adjust your thinking just a smidge: When you select, it does not copy. It acts just like in Windows... only you can also access the last selection on a way Windows prevents.

    Repeat: If your apps do not behave this way, /they are broken/. Don't blame *nix, or X, blame the author of the app. Some apps are deliberately broken (because it makes More Sense[tm]) but not terribly many.

    --
    I want my Cowboyneal
  35. Double bonus, since... by Ayanami+Rei · · Score: 2, Informative

    sites like slashdot, sa and 2/4chan people will purposefully not create clickable links, but type the URL-as-text. Just select, CTRL+N, middle click, no problem.

    The only thing that gets you is slashdot's page-widening-defeating mechanism. But you still have a chance to correct the typos in the URL bar if it 404s on you.

    --
    THIS THING CAN TURN ON A DIME, MACROSSZERO STYLE ALSO FUCK BETA, ~NYORON
  36. 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!
  37. Stop blaming Linux! by Dominic_Mazzoni · · Score: 2, Informative

    I can't believe this is still an issue! I can't think of a single Linux app that I still use regularly that doesn't support Windows-and-Mac-style copy and paste. I just copied some text from OpenOffice to Mozilla to Konsole, no problem. The GNOME and KDE folks agreed on a common clipboard standard years ago, and probably 90% of popular Linux desktop apps conform.

    Complaining because some free Linux apps still don't support the clipboard is like complaining that the Windows clipboard is broken because some freeware text editor doesn't copy and paste between programs.

  38. how it actually works: by Jamie+Zawinski · · Score: 2, Informative
    highlighting text in Linux automatically performs a copy

    Well, no, not really. Here's how it really works.

    I totally agree that too few Unix programs support the C-c/C-v idiom, but it's orthogonal to the select/middle-click idiom.

  39. Re:If only Linux would get copy-paste right.. by cozziewozzie · · Score: 2, Informative

    Yes, there is a solution. It's called KDE and has implemented what you wanted since KDE 3.0. If you don't like the old X way of copy/paste, then don't use it. Use a modern desktop environment, they all provide copy/paste functionality you are used to.

  40. klipper and ctrl-alt-v to save you from cb hell by neves · · Score: 3, Informative
    If you use kde, it comes with a nice task bar applet called klipper. It remembers the last copied texts. All you have to do is a ctrl-alt-v and it will list your last selections, choose the one you want to past, and midle-click where you want to past it.

    If you use mozilla/firefox, another nice tip is to use the plug-in diggler, it adds a cancel button beside the browser url location field. You can then just press it to clean the field, instead of selecting and pressing del, this way the selection won't go to the clipboard.

  41. in emacs... by davids-world.com · · Score: 3, Informative

    I have solved the problem in Emacs with a customization package: it defines Apple-C and Apple-V, because I found it too annoying on my Mac. It also doesn't put marked text automatically into the clipboard (or whatever the emacs folks call it: kill-ring). you can get a package here.

  42. Here's something close... by sakti · · Score: 2, Informative

    First 2 shell scripts:

    $ cat xcopy
    #!/bin/sh
    xclip -o -selection primary | xclip -selection clipboard

    $ cat xpaste
    #!/bin/sh
    xclip -o -selection clipboard | xclip -selection primary

    Then using your favorite keymapper set these to something close (M-c/M-v in my case). Here's an excerpt from my .bbkeysrc:

    KeyToGrab(c), WithModifier(Mod1), WithAction(ExecCommand), DoThis(~/bin/xcopy)
    KeyToGrab(v), WithModifier(Mod1), WithAction(ExecCommand), DoThis(~/bin/xpaste)

    Now alt-c copies highlighted text to the clipboard. Then alt-v copies the clipboard to the primary selection (so middle click them pastes it).

    Note that many programs that support C-c/C-v use X's clipboard selection. That means you can hit C-c in say firefox, them hit C-v, then middle click into an xterm and get the text you copied from firefox.

    Hope this helps.

    --
    "It is better to die on one's feet than to live on one's knees." - Albert Camus
  43. the "universal standard" still works by HtR · · Score: 2, Informative

    Generally speaking, these still work. I got used to them and still use them regularly today in virtually all Windows applications.

    By the way, Cut is Shift-Delete

    --
    Have you tried turning it off and on again?
  44. Re:Pasting urls - use Ctrl-L in Mozilla by Talthane · · Score: 2, Informative

    Cmd-L works in Safari too (as you might expect, since it and Konqueror are practically identical at times).

    --
    "This is why men never share their feelings; because women always remember." -Just Shoot Me.
  45. my notes by pixelbeat · · Score: 2, Informative

    X' clipboard confused my when I started so I made these notes:

    X has 2 clipboards. There is a selection buffer which is updated
    automatically when you select any text. You can paste from this
    buffer by clicking the middle mouse button.
    Then there is the clipboard (which can be managed using
    the xclipboard utility), which works like the windows equivalent
    (Ctrl+Insert or Ctrl+c for copy, and Shift+Insert or Ctrl+v for paste)
    Note gnome-terminal uses Shift+Ctrl+c and Shift+Ctrl+v instead.
    Note when you copy something in an X application
    and you close it, the content of the clipboard and selection
    buffer is lost (unless you use an external app to manage the
    clipboard (like xclipboard)).

  46. Re:Missing the real story by cthulhubob · · Score: 2, Informative

    X supports a similar method known as "content negotiation" whereby the programs decide between themselves on a compatible format for the data being moved.

    I just selected some HTML text, including a hyperlink, from Mozilla, middle-clicked in a GAIM window to send it to a friend and it showed up perfectly formatted, with an active hyperlink in it.

    If you want clipboard history / multiple clipboards, you have to use a third-party tool to do it, same as in Windows. It's called XClipboard.

    --

    In post-9/11 America, the CIA interrogates YOU!