How to send the escape character on OS X terminal?

45

8

Connecting with telnet looks like this:

$ telnet some.host
Trying 10.1.2.3...
Connected to some.host.
Escape character is '^]'.

I'm running this on the OS X Leopard terminal. Question is, how do I send this escape character? On a Linux terminal I'd try ESC-5 or CTRL-5, but I cannot figure out how to do this on OS X.

Ville Laurikari

Posted 2009-07-15T08:42:09.473

Reputation: 555

Answers

77

The ^] means ctrl + right bracket. As strange as that is, it works. You'll be taken to the telnet prompt, where you can type quit.

On international keyboards the ] character is often not a single key, and needs to be replaced with some other key. The correct key is typically the key to the right of P or the next key after that.

Here's a list based on comments below:

  • Finnish, Swedish, Norwegian, Danish: ctrl + å
  • French: ctrl + 6
  • German: ctrl + ü
  • Swiss: ctrl + ¨
  • Hungarian: ctrl + 5
  • Portuguese: ctrl + ´
  • Dutch, Belgian: ctrl + $
  • Canadian French: ctrl + ç
  • Italian: ctrl + +

jtbandes

Posted 2009-07-15T08:42:09.473

Reputation: 8 350

Ctrl+] is right! – Mark Turner – 2009-07-15T08:51:05.257

5Ahhh, of course. Except that with my Finnish keyboard layout, it's control + å. Naturally. Thanks :) – Ville Laurikari – 2009-07-15T08:53:00.760

This doesn't work on newer OSX machines, at least not with iTerm. – tedivm – 2017-12-21T21:36:45.170

In Spanish/Latin Keyboard it is Ctrl + 5 – Andrés Morales – 2018-12-03T17:56:26.207

Nothing works w/ Japanese keyboard. – Jonny – 2019-07-05T06:07:27.223

Turkish Ctrl + Shift + Ü – mcolak – 2019-07-31T11:21:07.863

1And on the french keyboard it’s ctrl-6. – kmkaplan – 2011-02-05T18:58:41.260

4On German Keyboard on OSX it is CTRL-Ü (Umlaut U) – None – 2011-07-29T18:54:54.820

1On a Swiss Keyboard it is Ctrl-¨. Why o why did the telnet developer need to use the group separator GS. So difficult to type on foreign keyboards. – Martin – 2012-05-08T15:31:44.583

4on Hungarian (and many more) it is Ctrl+5 – törzsmókus – 2012-05-15T10:13:34.510

1Ctrl+å in sweden – fredrik – 2012-10-11T07:13:26.123

1On a belgian keyboard it is ctrl + $ – tom – 2013-08-21T07:04:17.333

1

Workaround for those who have problems finding the shortcut:

  1. Change your systems keyboard language to U.S international - PC (System Settings/keyboard/input sources)

  2. Look at an image of a US keyboard layout and ctrl+] the corresponding keys on your keyboard

elhombre

Posted 2009-07-15T08:42:09.473

Reputation: 323