News for hackers. Stuff that matters.
Re:Major Linux Problems on the Desktop, 2016 Edition by sandGorgon on Wednesday December 30, 2015 @11:50AM (#10812889)
I don't understand - I never see a mention of the biggest annoyance to developers on linux : consistent copy paste. It is a cognitive exercise to copy from the terminal or paste to the browser...or (the horror) copy from the terminal and paste on vim.

It does not help that this works beautifully on the Mac.

Is this not an annoyance to anyone else...and more importantly, considering all distros are now using libinput,can I compile my own libinput that will universally copy paste using win+c ?

Re:Major Linux Problems on the Desktop, 2016 Edition by enobrev on Wednesday December 30, 2015 @12:53PM (#10813256)
Is the issue specific to terminal or are you seeing it somewhere else?

The issue is that the default terminal behavior of ctrl+c sends a SIGINT to the running application[1], and so terminal programs override it with shift+ctrl+c, and likely add the shift for the others for consistency.

I use "Terminator" as my terminal app - which allows you to set your keybindings - so I replace the "shift" in copy / paste and it's worked great for me for years. Unfortunately it doesn't allow you to override the SIG* keys, so it can be an issue when using `watch`, which removes your selection when it updates and then if you don't tap ctrl+x in time, it will send SIGINT the watch command, which is the exact opposite if what you want at that moment.

As for VIM, being sure you're in insert mode is essential no matter what OS you're using.

Is there anywhere else besides the terminal where copy / paste are inconsistent? I haven't seen any that I recall in quite a few years of Ubuntu on my desktop, laptop, media PCs, etc.

1: https://en.wikipedia.org/wiki/Control-C

Re:Major Linux Problems on the Desktop, 2016 Edition by sandGorgon on Wednesday December 30, 2015 @01:17PM (#10813384)
no please - I'm not talking about ctrl-C. I'm talking about CUA - https://en.wikipedia.org/wiki/IBM_Common_User_Access

Even on OSX, the bindings that are used are cmd-c and cmd-v. It is universal - if you have never used the terminal, vim and firefox on a mac... I really urge you to do that.

you'll see what i mean.

Re:Major Linux Problems on the Desktop, 2016 Edition by enobrev on Wednesday December 30, 2015 @01:40PM (#10813503)
I see, thank you for clarifying. Having used all versions of Windows up until 8[1] and 8+ years of ubuntu, I'm surprised I never realized this standard existed. It makes perfect sense that it does - I just didn't know it. I agree that it's unfortunate it's not as well supported on Linux as it should be.

Coming from the other side of things, I had a lot of trouble when I was lent a brand new Macbook Pro for travel during my last job. It seemed some things worked using cmd and others using ctrl. I don't remember the specifics, as I didn't use it often enough, except that I'd find myself mashing keys on occasion trying to figure out the right combination.

It was far worse when I dual booted with ubuntu. The keys made no sense to me there either. Finally, I replaced OSX completely and the keys were "normal" again (ctrl+* for everything).

1: Also lots of DOS, but I don't even remember what versions. I had managed lots of desktops and servers running DOS for a few years in IT a couple lifetimes ago.

Re:Major Linux Problems on the Desktop, 2016 Edition by eschaton on Thursday December 31, 2015 @04:51AM (#10816992)
You've got the causality reversed. The Apple Lisa introduced the command-Z/X/C/V keyboard equivalents for undo/cut/copy/paste, and they were kept with the Macintosh and Apple IIgs.

IBM CUA and Microsoft Windows adopted them afterwards, adapted to the PC keyboard; I think Windows only adopted them with Windows 95 and NT4.

Re:Major Linux Problems on the Desktop, 2016 Edition by pjmlp on Tuesday January 05, 2016 @07:28AM (#10842878)
No, they were already there in Windows 3.x
Re:Major Linux Problems on the Desktop, 2016 Edition by tatterdemalion on Wednesday December 30, 2015 @04:52PM (#10814603)
> Unfortunately it doesn't allow you to override the SIG* keys

You should be able to set these with `stty` (they're not actually a function of the terminal but of the tty, a detail no one should have to know).

Re:Major Linux Problems on the Desktop, 2016 Edition by audeyisaacs on Wednesday December 30, 2015 @12:21PM (#10813072)
Highlight to copy, middle-click to paste. Works every time for me.

Obviously, if you want to paste into vim you have to be in insert mode.

Re:Major Linux Problems on the Desktop, 2016 Edition by e12e on Wednesday December 30, 2015 @01:20PM (#10813394)
Technically vim exposes the x11 clipboards (plural) as registers - I never use registers, but I think

  "+p
[Ed: for those not familiar with vim: " can be thought of as 'with/from/into register named:', + is the register and p is paste. Similarily "+yw is 'yank/copy current word into register named +' ]

should be paste x11 selection. I don't normally use gvim/vim as an x11 application, but looks like * (star) is typically system clipboard:

http://vim.wikia.com/wiki/Accessing_the_system_clipboard

Re:Major Linux Problems on the Desktop, 2016 Edition by sandGorgon on Wednesday December 30, 2015 @01:25PM (#10813413)
why does it work on osx then ? is there something special happening at the OS level there ?
Re:Major Linux Problems on the Desktop, 2016 Edition by e12e on Wednesday December 30, 2015 @01:29PM (#10813443)
Afaik ctrl-v works in gvim? (I think its just bound to "+p or similar).
Re:Major Linux Problems on the Desktop, 2016 Edition by bla2 on Wednesday December 30, 2015 @07:42PM (#10815426)
Only with :behave ms (default on windows), else ctrl-v starts block visual mode.
Re:Major Linux Problems on the Desktop, 2016 Edition by ris on Thursday December 31, 2015 @07:28AM (#10817331)
Yes, except when you have to select something in between the time you copy & paste, e.g. change focus to the URL bar of a browser. Then ctrl-C is your friend, and works everywhere except the terminal.

But the terminal is a special case when it comes to copy/paste and always will be a little weird on any platform. Especially when it comes to line-wrapping in full-terminal applications like vi.

Re:Major Linux Problems on the Desktop, 2016 Edition by icebraining on Wednesday December 30, 2015 @12:30PM (#10813127)
Pretty much, never had a problem with it.
Re:Major Linux Problems on the Desktop, 2016 Edition by sandGorgon on Wednesday December 30, 2015 @01:20PM (#10813393)
my laptop does not have middle button. so I have to do a weird left-right button click. Very inconvenient for me.

I truly envy the OSX people just on this one aspect.

Re:Major Linux Problems on the Desktop, 2016 Edition by vodik on Thursday December 31, 2015 @03:40AM (#10816836)
shift-insert works in X if you can't middle click. In gvim too, out-of-the-box if you're in insert mode.
Re:Major Linux Problems on the Desktop, 2016 Edition by sandGorgon on Thursday December 31, 2015 @08:49AM (#10817532)
I was HOPING for that. Its part of IBM CUA. Unfortunately it doesn't work everywhere.. Especially the terminal (unless you remap keybindings)
Re:Major Linux Problems on the Desktop, 2016 Edition by aerique on Wednesday December 30, 2015 @12:02PM (#10812977)
Oh, this was an annoyance until I installed a clipboard manager (parcellite in my case) which automatically syncs the different clipboards.
Re:Major Linux Problems on the Desktop, 2016 Edition by sandGorgon on Wednesday December 30, 2015 @12:06PM (#10812995)
But how do you paste? I mean I have all sort of keymaps to enable paste in vim using CUA (shift-insert), but try explaining that to a first time user.

Its the small things that OSX does right.

Re:Major Linux Problems on the Desktop, 2016 Edition by icebraining on Wednesday December 30, 2015 @12:29PM (#10813123)
Why would you need keymaps? As far as I know, the terminal emulator (urxvt in my case) takes care of pasting the text into Vim. I never had to configure anything to use shift-insert or the wheel button to paste.
Re:Major Linux Problems on the Desktop, 2016 Edition by sandGorgon on Wednesday December 30, 2015 @01:18PM (#10813386)
ahh.. I see.

s/vim/gvim/g

Re:Major Linux Problems on the Desktop, 2016 Edition by EdiX on Thursday December 31, 2015 @05:19AM (#10817057)
Why would a "first time user" use a program that has a user interface designed in 1976? Why would a "first time user" expect this program to obey interface guidelines that did not exist until 11 years after that user interface was designed?
Re:Major Linux Problems on the Desktop, 2016 Edition by takhn on Wednesday December 30, 2015 @12:02PM (#10812972)
ctrl-shift-C on the terminal, ctrl-V on everything else. How is this a significant annoyance to you?