Dealing with the Unix Copy and Paste Paradigm? 1125
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?"
Common problem.. (Score:5, Insightful)
What annoys me the most is when copying/pasteing URL's. I'll highlight© 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
Pasting urls (Score:5, Informative)
But i do feel your pain
Firefox and Konqueror should have a button for "Open the clipboard in a new tab".
Re:Pasting urls (Score:3, Informative)
Doesn't help the general problem though...
Re:Pasting urls (Score:5, Informative)
"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.
in emacs... (Score:4, Informative)
Re:Pasting urls (Score:3, Informative)
Re:Pasting urls (Score:5, Informative)
Your choice.
Re:Pasting urls (Score:5, Insightful)
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.
Re:Pasting urls (Score:4, Insightful)
The broken part is that they are two systems.
I have two different systems for heating food in my kitchen. Is that broken? No, and neither is X cut-n-paste, for the same reason. The two different systems are separate, distinguishable and serve different purposes.
The only brokenness is the number of old apps that don't use the selection and clipboard correctly. If you stick to well-written applications you really don't even need to know about the selection/clipboard duality. But you'll be more effective if you do understand and exploit it.
Re:Pasting urls (Score:5, Informative)
Agreed. While not a perfect solution, Clipboard Observer [sakura.ne.jp] 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 [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.
Re:Pasting urls (Score:4, Funny)
Yeah, he should. Funny that you don't mention his name though, isn't it?
Re:Pasting urls (Score:4, Interesting)
And isn't the normal response to any installation with extensions installed to advise removing the extensions first and seeing if the problem lies with the extension code, thereby moving the onus of fixing the problem to the extension developer?
Re:Pasting urls (Score:4, Informative)
Re:Pasting urls (Score:5, Funny)
Re:Pasting urls (Score:5, Informative)
Re:Pasting urls (Score:5, Informative)
Try middle-clicking in the main view area of mozilla/firefox with a URL in the clipboard...
Re:Pasting urls (Score:4, Interesting)
But, especially if I'm entering lots of data, I'll occasionally miss the input field when I middle click, then, even though what I have pasted looks *nothing* like a URL, firefox will in it's infinite wisdom try to load something, anything, it's not even sensible about it, I get odd pages I havn't been to in months, strange things completely out of the blue. And if I don't hit escape quick enough it'll load the 'supposed' page I wanted and then when I hit back, all the data I entered into my form is gone (because it came from an expired form post and had to be reposted to the server to generate the form again).
ARGH! I *HATE* THAT "FEATURE".
Re:Pasting urls (Score:5, Informative)
Re:Pasting urls (Score:4, Interesting)
Ctrl-T (new tab)
Middle click on the location bar (paste url)
Enter
Also, Ctrl-U clears the location bar.
Re:Pasting urls (Score:4, Informative)
Re:Pasting urls - use Ctrl-L in Mozilla (Score:5, Informative)
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.
Re:Pasting urls - use Ctrl-L in Mozilla (Score:4, Interesting)
So this trick is cross browser.
Also, AlT+D in IE does the same thing as CTRL+L in Mozilla.
Re:Pasting urls (Score:5, Interesting)
Honestly, I never use a clipboard to copy anything other than text. If I must use a mouse to copy something, I will drag & drop it, not select, copy, select insert point, paste. Honestly, I don't get the whole copy/paste using the Windows style. X's highlight/copy & middle click paste is so much more useful, when used with klipper (or presumably gcm), which eliminates the one weakness of it, and actually makes it better (multiple item storage).
People should try to adapt. Middle click in any browser with a url (at least among konqueror, mozilla & derivatives, opera & everything I can recall using except links.) & it opens it, no need to go to a location bar. Or drag the url & drop it on a browser window.
So many ways to do it, but people will whine that 'the one way' doesn't work. It makes me wonder if there is an intuitive interface for a computer AT ALL. (And, NO, Mac Zealots, the Mac doesn't qualify!) Current GUIs aren't, CLIs don't seem to be, & voice commands are unlikely to be in my opinion.
Re:Pasting urls (Score:5, Informative)
Re:Common problem.. (Score:5, Informative)
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
Re:Common problem.. (Score:5, Informative)
Yeah, there's basically two clipboards.
Yup. The best explanation I know of how this works [jwz.org] from someone who would know :)
It's not a feature, it's a bug (Score:5, Insightful)
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.
Re:Common problem.. (Score:5, Insightful)
IIRC, what should happen is the primary selection (ctrl-c/ctrl-v) should be seperate from secondary selection (select text, then middle click)
Re:Common problem.. (Score:4, Informative)
Re:Common problem.. (Score:4, 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.
Re:Common problem.. (Score:5, Informative)
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.
try going back to windows (Score:3, Interesting)
Re:try going back to windows (Score:4, Interesting)
No matter how much windows users complain about it, middle click selections are sooooo useful if you understand them.
X copy/paste (Score:5, Informative)
The current consensus on freedesktop.org is something along the lines of:
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 [freedesktop.org]
Re:X copy/paste (Score:3, Insightful)
This probably doesn't need to be implemented at a client level though, perhaps a
Re:X copy/paste (Score:3, Informative)
Re:Common problem.. (Score:3, Informative)
Re:Common problem.. (Score:5, Insightful)
Because you really should.
Re:Common problem.. (Score:3, Informative)
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.
Re:Another Annoying Linux-Ism (Score:3, Informative)
setenv TERM ansi
then I always use the ansi terminal settings (i.e. backspace not Ctrl-H)tset
Your proiblem... (Score:4, Insightful)
Re:Your proiblem... (Score:4, Informative)
Minor solution - Ctrl-K (Score:5, Informative)
Re:Minor solution - Ctrl-K (Score:4, Informative)
Many of the bash control sequences do the same thing in web browsers. In most text editing situations, really.
bash can use either emacs or vi ctrl keys (Score:3, Informative)
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
I wish! (Score:3, Insightful)
I wish. That's the behavior that I prefer. In the past half-year, I've tried about four different distributions, and none of them have had that as the default behavior. It seems like they're intentionally trying to become like Windows.
steve
Re:I wish! (Score:4, Insightful)
Linux is not Windows. Stop trying to make it as such.
This is a usability problem... (Score:5, Interesting)
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
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!)
Re:This is a usability problem... (Score:3, Insightful)
That is my biggest issue with the linux/open source world. Not that in particular, but the lack of standardization. The lack of standardization of shortcut keys, graphical interface design and general look-and-feel of the interface.
For me, usability is much more important then functionality. I wouldn't run a server on anything else but a little more maturity is needed to get me to use linux as a home system.
Re:This is a usability problem... (Score:4, Interesting)
to cut & paste
You obviously don't use a dvorak keyboard.
ctrl+j and ctrl+k
Re:This is a usability problem... (Score:5, Insightful)
The confusion arises when Mac/Windows people arrive and want to bring their habits with them. This is completely natural. However, there has been and will continue to be strong resistance (I'll lead it myself if needs be
I think a more reasonable solution might have been to just stick with highlight, middle click as a single, consistant standard and just teach it to newcomers. At least you'd dodge the apparent confusion that comes from partial, but not universal support of their familiar method. Better, but more labor-intensive (the true capital of the open source world) would be to have selectable behavior by a global X-server level (or perhaps window manager level) toggle.
All that said, the idea of having to use both keyboard and mouse for such a fundamental operation is just so horrifyingly backwards and wrong, and it amazes me that anyone who's experienced X11 could possibly go back to such an arcane and user-hostile configuration.
Re:This is a usability problem... (Score:5, Insightful)
Re:This is a usability problem... (Score:5, Insightful)
And yes I wrote this in a terminal and selected/pasted it with the button.. because Control-C doesn't work in the terminal!
For the terminal at least, there is a good reason for this. You are basically running a console program inside a window, and this console application has it's own meaning for control keys. For example ^C sends SIG-INT to the current program. In pico ^C is shows the current line number. Emacs would be unusable without ^c and ^x. So the terminal emulator interpreted ^c and ^v as copy and paste, instead of passing them onto program running in the terminal, then all of these commands for all of these programs would stop working. Some people have suggested intercepting ctrl-c and ctrl-v for copy and paste and then having buttons you can click to actually send the command. I have tried this and found it to be much worse than the original problem.
Because the terminal was the first application to run in X, the designers wanted a way to copy and paste that didn't conflict with these existing keyboard shortcuts. However, any existing keyboard shortcut could concievably already be used by an existing console program. Since the mouse was the only new input for X they came up with the mouse-only copy and paste that we have now.
There really isn't any way to make the ctrl-C, ctrl-V method of copy and paste compatible with terminal applications. It just isn't possible. However there are other ways of doing copy and paste that are compatable with the terminal, by adding additional keys to the keyboard. For example, OS X uses the cmd key for all shortcuts, which doesn't interfere with ctrl shortcuts in the terminal. Some UNIXes have had dedicated copy and paste buttons on the keyboard.
However, seeing as how there would be great revolting if gnome or kde tried to get rid of ctrl-c, ctrl-v and replace them with alt-c,alt-v that it will never happen. The terminal emulator will just have to remain an oddity in these desktops.
Re:This is a usability problem... (Score:5, Funny)
That's easy.
Needing a Copy key, C was selected. Because C stands for Copy. Needing a Cut key, X was selected. Because X is a convenient mnemonic for 'cut'. Needing a Paste key, V was selected. Because V stands for "It's next to the Copy key, dumbass."
No charge.
What middle button? (Score:5, Insightful)
I used to run into the same problem, but you already know the solution: use ctrl-c and ctrl-v. If an application doesn't support them, scrap it. Just ignore your middle mouse button -- pretend it isn't there -- and you won't have this problem.
Re:What middle button? (Score:5, Informative)
http://freedesktop.org/Standards/clipboards-spe
Middle button? (Score:5, Funny)
I use a Mac you insensitive clod!
Re:Middle button? (Score:3, Funny)
My mac runs yellow dog linux with a three-button usb mouse, you insensitive clod!
Re:Middle button? (Score:5, Funny)
I use a Mac you insensitive clod!
If you only have one button, it is the middle button...
Re:Middle button? (Score:4, Funny)
I've always thought it odd that Mac users don't have a middle button.
I _know_ they have a middle _finger_ because they show it to me all the time...
---
(Sure, mod it flamebait. I _am_ an insensitive clod.)
Oh boy (Score:4, Informative)
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. [jwz.org]
Re:Oh boy (Score:4, Insightful)
Basically, this guy is complaining that things are working in the way they should, but not how he wants them. I'm not sure how to make it convenient for him without breaking other stuff. Look at it this way, he could just use the same way that works on Windows/MacOS, but he's not, then complains that it's broken. What's up with that?
Complain! (Score:5, Interesting)
As a slight correction, the copy-paste problem you describe isn't a Linux issue; it's an X Window System issue.
-1 Redundant (Score:5, Informative)
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.
Re:-1 Redundant (Score:3, Insightful)
that's a matter of opinion. if you hadn't gotten used to the way ms windows does it, you wouldnt be complaining. i've been using linux only for a bit under 3 years, and don't have a problem with the cut/paste situation.
it's only good for text.
across all desktops and all apps, this is true, although within certian environments, you can drag 'n drop, and cut/paste images and text. I can cut/paste html from mozilla browser into mozilla mail. in openoffice I can cut/paste imag
Yes, there *IS* a common clipboard standard! (Score:5, Informative)
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.htm
http://pdx.freedesktop.org/Standards/clipboards
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.
Re:-1 troll/idiot/wrong (Score:3, Insightful)
I understand X's seperate buffers. I understand in one app it may be Ctrl-C to get the clipboard buffer, in another it may be Alt (oh excuse me, Meta) Q. Who knows.
I also know that most apps have their own redundant application-level cut/copy/paste. In pico/pine/nano its Ctrl-K for cut, and Ctrl-U for un-cut. I know if I want to cut and paste within a single text file I can use C-k and C-u to move lines. If I want to move text from xterm A to OOo documen
KDE klipper... (Score:5, Informative)
Or else, first paste what you want to insert, then delete what you want to remove...
Of course, no solution, but tale from trenches ... (Score:4, Funny)
When I'm on Windows I use Trillian which does this and i have a habit of highlighting as i read ... and sense i frequently copy links to send ... I am always pasting into Trillian ... unfortunately this has caused some problems with my gf when i highlight something that she doesn't need to see ....
I prefer the X way, kind of... (Score:4, Insightful)
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:
1. Focus on the address bar.
2. Hit Ctrl-a to go to the beginning of the line.
3. Hit Ctrl-k to kill the contents of the address bar.
4. Click on the address bar with the middle mouse button to paste the new contents.
I, personally, would like the best of both worlds, but that would essentially require that the system read my mind. Obviously, we're not there yet.
Re:I prefer the X way, kind of... (Score:5, Funny)
But this could lead to other problems, such as your brain causing the machine to start browsing porn sites when that pretty secretary from across the hall walks in.
Re:I prefer the X way, kind of... (Score:3, Insightful)
no solution to a non-problem (Score:3, Informative)
So what is the problem? Are the apps you use broken?
If only Linux would get copy-paste right.. (Score:5, Interesting)
Another thing that Linux needs is a proper clipboard like Windows has. Copy anything you like: pictures, files, texts, documents. Then paste it into any application that will accept the data type. I do my day-to-day work in MS Windows, and this is one feature that I use very often, without having to think about it. Is there anything similar for Linux in the making?
Re:If only Linux would get copy-paste right.. (Score:4, Insightful)
What are we comparing this to? Windows? Windows copy/paste is not exactly superior. Try, this for example: click once and then drag to select text. The first click will cause you to be selecting in units of single characters. Now try again, but click twice instead. Presto! You are selecting one word at a time.
OK, what happens if you triple-click? In Internet Explorer, this selects the current block of text, kind of like a Select All. In Notepad, it does NOTHING. In Mozilla, it selects a whole line at a time, but if you drag to the previous line, it goes back to selecting in units of characters and not lines! Gaaaaaaaah!
Is this the consistent, clean interface that X11 is supposed to want to copy? In this example at least, Windows has three different behaviors for three different apps. In X11, all the apps I can recall using operate exactly consistently. One click selects letter-at-a-time, two does word-at-a-time, and three does whole-line-at-a-time. And by the way, once you start selecting line-at-a-time, when you drag the mouse up or down, the additional selection is also done line-at-a-time.
Furthermore, I challenge the assumption that the Macintosh style of doing things (i.e. the one Windows copied) is more intuitive. It only seems intuitive to you because you've already learned it, so it's second nature. In contrast, I started using X11 fifteen years ago, and I got used to being able to just select text and move on. Now I am using Windows and Mac on the desktop mostly, and I cannot count the number of times that I've selected some text to copy, then rearranged all my windows and iconified the one that had the text, then gone to paste it into another app. But of course, all the effort is wasted because I forget the extra step of hitting Control-C (or Apple-C). Why? Because my intuition and habit tells me that I just select the text then immediately start navigating to the place where I want to paste it. I've been using Mac and Windows on the desktop for a year now, and I still sometimes forget and have to go back to start over, remembering to hit Control-C. The point is, just the fact that transition trips you up does not mean that the one you're familiar with is better. In fact, the transition in the other direction is just as exasperating.
Something the Window Manager should handle? (Score:3, Interesting)
A simple, high-level, question: why can't the Window Manager (Gnome, KDE, etc.) be made to handle both schemes, and allow the user to switch between them, but not let both scheme be active at once? This would of couse require support in the applications running under the WM's, but I would figure such a change in inevitable if the Linux desktop is to become more mainstream.
Clipboard Program (Score:3, Informative)
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.
X Selection (Score:3, Insightful)
Linux automatically performs a copy while the middle mouse button performs a paste.
This has nothing to do with your machine running GNU/Linux it is the X selection mechanism and its use for copying text. You'd have the same issues on any machine running diverse free software X based applications. There is no good answer for you. It is one of the weaknesses of a federated system.
Word of wisdom: emacs (Score:3, Informative)
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.
Everyone has it wrong all the time (Score:3, Informative)
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 [jwz.org] to the topic for more information.
I don't know what software you all are using... (Score:5, Informative)
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...
The solution (Score:3, Insightful)
1) I highlight a URL in some text.
2) I highlight the URL selector in Mozilla - this causes the previous highlighted text to lose focus and causes it to go to clipboard.
3) I middle-click the URL in Mozilla (which never lost focus) and the clipboard text goes in.
Not sure how "focus" actually works in this case, but you should be able to understand what needs to change to make it work. And for goodness sake have the FSF patent this so only Free Software will be able to use it. As the "inventor" can't I still patent for a short time after this public posting?
Here is the way it SHOULD work. (Score:5, Funny)
If your mouse has less than four buttons, it's broken. Get one with four buttons.
Simple. Clean. Logical. Convenient.
I like it this way so this is the right way.. I know what I like, and that makes me a UI expert.
If anyone wants it any other way, well, let them set it as a non-default user preference. And if the preference isn't honored by every application, well, tough.
Re:Here is the way it SHOULD work. (Score:5, Funny)
Ctrl Insert, Shift Insert (Score:3)
Works on some linux apps and desktops, still works in windows.
I have my putty setup as an X window, middle mouse click, right mouse extends, middle pastes.
What pisses me off is command shell for windows, I just start up sshd under cygwin and use putty to ssh into my own windows box. Much better...
the "universal standard" (Score:5, Informative)
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..
Re:the "universal standard" (Score:5, Informative)
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
Excellent article on the subject (Score:5, Informative)
In a nutshell, there are TWO completely different clipboards implemented in X:
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 [freedesktop.org].
Missing the real story (Score:5, Insightful)
I can copy text from VS and paste it into Word, in which case it pastes as RTF with colors and formatting. If I paste it into notepad, I get plain text. This is because the clipboard understands high-level text (RTF) and casting that down into standard text. It also allows apps to provide multiple data formats; copying an image can put a JPG, Bitmap, and PNG on the clipboard and the consuming app can select the format it likes best.
Even better would be to support Office-style multiboard functionality where there are 10-12 "slots" on the clipboard and you can cut and paste from each slot at will.
(Ex: in VS, CTRL+SHIFT+V will cycle through each of the last X copied items for pasting, meaning you can go to one spot of code and copy, then another and copy, then open a different source file and copy a block, then paste all three together somewhere else very easily.)
But wait... (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...
Re:Training and repetition (Score:5, Interesting)
Saying that you deal with a technical problem by getting used to it, is saying that technology will fail to address the problem. As you say, "Linux is different" (almost true, since it has almost nothing to do with Linux, but rather with X-Windows). I would rather say:
X-Windows clipboard management sucks. If you want to use Linux on the desktop, you'll have to get used to it.
The lack of a decent standard allow everyone to do everything. And they do. And we are left with a huge app base for X, with very high UI fragmentation. Hence, what you learn to do with one app is different with another one.
Annoying, but that's the way X is.
you are wrong (Score:3, Informative)
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.
Re:This is the correct behavior (Score:3, Funny)
Adapting to stupid, broken, and braindead things -- such as the X cut and paste lossage -- is itself stupid. Here's a nickel, kid. Go buy yourself a real window manager and toolkit.
Re:"Correct?"-- A bit off topic, a bit flame-y (Score:5, Insightful)
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
Re:"Correct?"-- A bit off topic, a bit flame-y (Score:3, Interesting)
If the 'typical mother' had started with a DEC instead of Win3.x/Win9x, middle click paste would have been the 'correct and expected behavior'.
Re:"Correct?"-- A bit off topic, a bit flame-y (Score:3, Insightful)
So, basically, the clipboard would work OK for your mother. It's power users who try and combine both mechanisms at once then get confused who it doesn't work for, but there's no way around that.
The real problems with the X clipboard have more to do with handling large quantities of
Re:This is the correct behavior (Score:4, Insightful)
Re:The writer needs a clue. It is orthogonal. (Score:5, Insightful)
Telling someone that they are clueless beacuse they use a differnt setup than you is not very helpful.
Re:The answer is ... jedit (Score:3, Funny)
For a second I read "jedi"... I was like: What? Use the force to move bits now
Re:The answer is ... jedit (Score:3, Insightful)