Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

For copy-pasting text to/from the terminal, I prefer to use Mac shortcut Cmd+C. It doesn't work out of the box on Linux (you have to use Ctrl+Shift+C, because Ctrl+C sends SIGINT). But there's a simple way to make Cmd+C work universally across all apps by rebinding Cmd+C to send Ctrl+Insert and Cmd+V to send Shift+Insert. It turns out these alternative keybindings work everywhere (browsers, GUI apps, terminal, etc). I use keyd to do that in software, but some QMK keyboards can do that rebinding on the keyboard itself.

This is my keyd config:

  [ids]
  *
  
  [main]
  capslock=overload(control, esc)
  leftalt=layer(meta_mac)
  leftmeta=layer(alt)
  
  [meta_mac:M]
  c=C-insert
  v=S-insert


I don't remember if I did any special config in iTerm or installed a nonstandard package (I don't believe I did), but in Mac I often find it easier to just pipe a result I want copied into the `pbcopy` command in order to capture it in the clipboard, rather than trying to highlight what may be a long output.


> I don't remember if I did any special config in iTerm or installed a nonstandard package (I don't believe I did)

You are remembering correctly, pbcopy (and it’s partner pbpaste) are preinstalled on all Macs as part of the OS.


Then how do you SIGINT?


What they're saying in Linux terms is that they map Super+C to Ctrl+Insert, so Ctrl+C still sends SIGINT.

See also IBM CUA: https://en.m.wikipedia.org/wiki/IBM_Common_User_Access


Right. Ctrl+C is still mapped as usual.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: