Hacker News new | ask | show | jobs
by thomastjeffery 1930 days ago
Usually in Linux (specifically in Xorg) it's select to copy and middle click to paste; which uses a separate buffer from the C-c/C-v clipboard.

Personally I find this method much more usable than the traditional windows-style clipboard.

Either way, you want to generally avoid C-c for copy in terminals because it's already bound to the all important "send sigterm signal to foreground process". This is on a long list of ancient cruft that exists in terminal emulators and shells.

3 comments

The nice thing about how I wrote Kinto is that it supports numerous Terminal applications and the Cmd key location becomes Ctrl+Shift+(the_key_press), so you effectively have everything you'd want without needing contort your fingers for another modifier key.

I am serious about not wanting users of Kinto to feel like they are dying a death of a thousand paper cuts because they have to stop what they are doing and add yet another keymapping. Kinto can't get every app remapped right 100% of the time - but it gets awfully close still.

Initially I did not write Kinto that way because I didn't think it to be all that possible and with setxkbmap it was very difficult to understand and properly implement such a configuration. Probonopd, who does write some wonderful articles about UX related topics that I've also seen hit the frontpage here mentioned not wanting to remap terminals at all - I agreed and eventually delivered. He also made sure that I worked out wordwise hotkeys as well.

Also with it being rewritten, several months ago, to use xkeysnail it is also very simple to add additional hotkey remappings to as well.

> generally avoid C-c for copy in terminals

Absolutely. But it's not cruft. It's the original meaning of the character, and the standard method of generation.

Ctrl+C is just like any other keypress which maps to a standard ASCII representation.

The error is in reusing ASCII chars for GUI actions. This was an obviously-bad idea in 1985, and it has never become a better idea.

That's the traditional perspective.

My perspective is that control characters were a bad idea from the beginning. Then again, so are ubiquitous predefined keyboard shortcuts like C-c.

Having user interaction predefined makes it more difficult to change keyboard layouts and shapes.

Control chars are in-band signalling. This is always "bad", but sometimes it's all you have. Certainly back in the early days of wired serial connections, that was the case.

So if you have in-band signalling, you need a method to generate those signals. I don't think there was any other viable way to solve this problem, and honestly it has worked almost flawlessly.

Of course Microsoft is a big exception, but that could hardly have been predicted 20 years earlier.

So your entire point is that control characters are still good because they were a good solution to a problem that only existed 20-30 years ago? I'm not convinced.

My point here is that we are so steeped into tradition that usability suffers.

I really don't think that's true. It's not tradition, it's practicality -- control characters are good because they are established, standardized, and work perfectly to solve an ongoing need.

In-band signalling is inherently a bit of an architectural challenge. But the problem is solved. The entire internet is run on in-band signalling! We're going on 35 years for TCP/IP, and more like 50 for ASCII control chars. They work very, very well.

Yes, Microsoft broke control character generation for users of their OS, but that's a compartmentalized failure, and easily avoided. The Ctrl+Shift GUI workaround in Windows (and copied in Linux) is not elegant. But any alternative without control chars would be a total loss of functionality.

Ctrl+C being broken by Copy is a trivial example. There's a whole alphabet of control chars (in fact there are 32), and we all use more of them than most people realize[0]. Some have dedicated keys on the keyboard (backspace, return), but obviously not all of them.

I use about a dozen control characters regularly. This is not unusual for someone who works closely with server operating systems.

[0] I'm not sure how to gauge your knowledge of communication signalling or protocols, so I apologize if I'm being pedantic. It sounds like you have ideas about alternatives (and this is interesting to me), so I am curious about any specifics you can share or link to.

> Either way, you want to generally avoid C-c for copy in terminals because it's already bound to the all important "send sigterm signal to foreground process". This is on a long list of ancient cruft that exists in terminal emulators and shells.

stty intr ^X

Then ctrl-c will no longer bother you, and your muscle memory will quickly adapt as X is very close to C

I mapped intr to control g some 30 years ago. It's the interrupt key in emacs. I gave up after some months because I still had to use control c on any terminal that I didn't control.

By the way, I don't even know if I could paste with control c or control shift c back then. Maybe there was only middle click.

I could try again now and see what happens.

I didn't know you could do this before this thread this is a great idea.
Muscle memory doesn't help with "not quite what I'm used to, but it's very close". It doesn't handle conditional statements.