6 ms·
> One of the most common use cases for the `ctrl` key is COPYING shit and followed by PASTING shit and it DOES NOT WORK in a fucking TERMINAL... Because `ctrl-c
by chmln 6y ago
> One of the most common use cases for the `ctrl` key is COPYING shit and followed by PASTING shit and it DOES NOT WORK in a fucking TERMINAL... Because `ctrl-c` sends an interrupt
Most terminals today have a copy-on-select feature, which means you don't need to ctrl-c at all. Just select and ctrl-v.
- jacobolus 6y agoA large number of keyboard shortcuts are in conflict. "One specific keyboard shortcut has a mouse-based workaround" is not really a good answer. The Windows GUI copied the Mac’s keyboard shortcuts (originally from Lisa?) but didn't have a dedicated key for them so re-used the existing Ctrl key, which already had a meaning on text-based operating systems. (This happened because Microsoft had no input into hardware keyboard layouts, and wanted to make software compatible with the plethora of IBM-Model-M-layout keyboards available in 1985–1990.) Then Linux GUIs wholesale copied every feature of Windows they could including the keyboard shortcuts, in a context where this was even worse, because now existing Ctrl-based shortcuts from terminal software were directly in conflict with new Ctrl-based shortcuts from Windows.
- fishywang 6y ago>One specific keyboard shortcut has a mouse-based workaround Except for that particular action (select some text on terminal then copy) you have to use mouse to do the "select" part anyways.
- pmontra 6y agoThat's why I never connect a mouse on my laptops. I've got a touchpad that's part of the keyboard. I select text with it and paste with its middle button. I only buy laptops with three physical buttons precisely because of this user case. A mouse would slow me down. Where a mouse is really needed is in action games. A touchpad is too slow there.
- fishywang 6y agoDoesn't the word "mouse" include trackpads in most context?
- pmontra 6y agoMaybe, but I'm not sure about it. They are very different in location and interaction patterns. In this context there is a lot of difference between a mouse and a touchpad. For example, I select text with the keyboard most of the times in emacs and in any other input box (not in vim, is it even possible?). So I'd lose time by reaching to a mouse. I hardly have to move my hands to use my touchpad.
- thomastjeffery 6y agoUsually 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.
- quesera 6y ago> 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.
- thomastjeffery 6y agoThat'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.
- quesera 6y agoControl 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.
- thomastjeffery 6y ago
- francislavoie 6y agoThat's actually the worst though. I use selecting to highlight text that I'm reading as an aid. Copy-on-select is a huge dealbreaker for me because it clobbers my clipboard when I don't want it to.
- michaelmrose 6y agoTo be pedantic X11 has a copy on select feature which works on virtually all applications. This means you get by default 2 different clipboards although some environments/applications have an option to sync them among other additional features like being able to select from the last n pastes which may be optionally persisted through reboots for example.
- matthewmacleod 6y agoI want to chip in here with a rant of my own because I absolutely fucking hate this feature. The idea that something I think of as a passive action—selecting text—can destructively alter my clipboard makes my skin crawl, and it's baffling that anyone thinks it's a replacement. The thing is it's the default on iTerm2 on the Mac, so every time I set it up I spend a week thinking "why is my clipboard always completely full of shite" before I remember and turn it off. (YMMV, you may like this, you may actually have proper clipboard management, and so on. I didn't say this was a logically consistent rant.)
- toxik 6y agoThat’s not true, iTerm2 doesn’t overwrite your clipboard. It, like it’s forebears, uses a separate selection buffer. The only way to paste from it is middle mouse button as far as I know.
- matthewmacleod 6y agoIt 100% does. The "Copy to pasteboard on selection" option causes selected text to overwrite whatever's on the clipboard, and I just checked. It's possible that this isn't enabled by default, but I'm virtually certain it is because it catches me out every time.
- toxik 6y agoAha well then, we have differing experiences
- michaelmrose 6y agoI don't think Mac OS actually natively supports select to copy so ITerm2 as an app implements it by filling the same clipboard buffer you would otherwise use. X11 by contrast has by default 2 buffers so you never clobber your buffer filled by control+c however some clipboard management software optionally syncs the 2 buffers bringing back the behavior you dislike.