5 ms·
Being able to CMD+c to copy things in a terminal is one of my favorite things about programming on a Mac. Ctrl+c to copy everywhere, except the terminal (there
by jetpackjoe 4y ago
Being able to CMD+c to copy things in a terminal is one of my favorite things about programming on a Mac. Ctrl+c to copy everywhere, except the terminal (there it instead is an interrupt) is a major annoyance working in Linux
- jmprspret 4y agoI don't use a Mac. How does one interrupt a program if Ctrl+C is bound to copy? At this point when I'm in a terminal Ctrl+C is muslce memory for interrupting a running program.
- gregsadetsky 4y agoOn Macs, Cmd+C to copy and Ctrl+C to interrupt in the terminal i.e. they’re different.
- samtheprogram 4y agoCtrl-C is still bound to an interrupt — it’s Cmd-C (i.e. Super-C / Win-C) that is bound to copy. Most things that a regular user can think of (paste, print, select all, to name a few) that would be control mapped in user facing programs are typically mapped to the “command” key instead.
- kalleboo 4y agoMacs have a Meta key called Command that can be dedicated to the shortcuts defined in GUI applications while leaving Ctrl free to be used by console stuff. So all the GUI copy/paste/windowing etc controls use Command key shortcuts. The original 1984 Mac keyboard did not even have a Ctrl key, it was added to later keyboards as people wanted access to terminal applications.
- jmprspret 4y agoOf course! Sorry, I did know this but I always forget macs have Cmd and Control
- wodenokoto 4y agoOn Mac, ctr+c is not bound to copy. cmd+c is bound to copy. ctr+c will interrupt in a terminal. On Windows, ctr+c in a terminal will interrupt a running process, or, if text is highlighted, will copy that text instead of interrupting. It works really well, and took me a long time of doing this without issues to realize what I was actually doing.
- adastra22 4y agoI have used Windows all my life, and I learned this just now. No one ever told me that!
- horsawlarway 4y agoIf it helps, the vast majority of linux terminal emulators support rebinding ctrl-c to copy and ctrl-v to paste. Or simply copying to clipboard on select: https://wiki.archlinux.org/title/Copying_text_from_a_terminal https://wiki.archlinux.org/title/Copying_text_from_a_termina... The default is usually ctrl-shift-c to copy and ctrl-c to send sigint - but setting the copy command to ctrl-c will usually flip them, making sigint ctrl-shift-c. I enable this on basically all the terminals I use. I also immediately rebind cmd to ctrl in mac, since I can't stand the RSI inducing placement of the cmd key.
- sbuk 4y agoCtrl-v was SIGINT long before it was a shortcut for paste (first added in Windows 3.1). Although it can be switched now, it hasn't always been so. Of all the things that desktops (I'm not going to say Linux, as it isn't a Linux issue as it affect every system that uses KDE/GNOME and the like) designed to run on top of *nix like systems that were copied from Windows, this one really boggles my mind.
- deleted 4y ago[deleted]
- tasuki 4y agoIt isn't an annoyance for me: just select text and paste it with middle click? Why bother with ctrl+c ?
- trebbble 4y agoThen you can select other text to paste over.
- prmoustache 4y agoThe difference being that on linux you are for the most part free to implement the keybindings you want. Example on Kitty, my current preferred terminal emulator this is just a few map directives away in the config: map ctrl+c copy_to_clipboard map ctrl+v paste_from_clipboard map ctrl+shift+c send_text all \x03