I've been trying for quite some time now to figure out how I'm supposed to type the escape sequence '^\', Control+Blackslash on a Mac.
I have a Swedish keyboard with the Swedish Pro layout, and I have backslash on Shift+Alt+7, but pressing Ctrl+Shift+Alt+7 just gives me a 7, not the escape sequence I would expect.
The closest thing I found while googling is: How do I send C-/ (that is, control-slash) to the terminal?
But it doesn't give away how to do the Control+Backslash, any ideas?
Best Answer
As a user of the Danish Apple keyboard, I face similar issues. Most of the time I — unfortunately — have to remap keyboard shortcuts through System Preferences > Keyboard > Shortcuts. I researched a bit and wasn't able to find the native way to do this combo on a Scandinavian keyboard.
However, you might be able to create a service through Automator that presses the keyboard combination for you:
(* Your script goes here *)
withtell application "System Events" to keystroke "\\" using {control down}
Then try running it at a time when you need to press Ctrl+\ (For Terminal: Terminal > Services > Name of Your Service).
I'm not currently able to test this but it might be worth a try.