TransWikia.com

Which is correct, iTerm or Terminal? (Option as Meta or Esc+)

Ask Different Asked by Dogweather on January 27, 2021

Each provides the ability to change the behavior of Option: as Normal, Meta, or in iTerm only, Esc+. However, an interesting phenomenon is, in order to have Emacs-style shortcuts at the command line, they require contradictory settings:

  • iTerm: Esc+
  • Terminal: Meta

Example hotkeys enabled are Option-b to back up a word and Option-f to move forward a word.

iTerm doesn’t work if also set to Meta. So, it seems that they understand "Meta" to mean different things.

My question: Which one’s right? Is it Meta or Esc+ that enables this Emacs-like behavior? Or maybe, they’re both right, but map the keys differently?

One Answer

Neither is correct nor incorrect.

The ESC control code is part of the ANSI escape sequences which was used to send control codes to early terminals like the VT-100. Emacs used many of these Esc sequences to control how the the user interacted with the program.

The Meta key first showed up in 1970 on the SAIL (Stanford Artificial Intelligence Labs) keyboards, MIT’s Lisp computers and ultimately Sun Microsystems (my alma mater as tech companies go). It appeared as a diamond key.

The Meta is a modifier key similar (in function) to what the Apple Command key was. On modern keyboards, it maps to ALT (Option) or the Windows key on PC keyboards. If a computer lacks the Meta key, you can send the ESC sequence.

Either one is fine, iTerm (IMO) seems to take a more global approach to connecting to various *nix machines where Terminal is Apple/OpenStep (since Apple acquired them) and uses a Meta key.

In the end it’s what you’re more comfortable with - Esc or Meta/Option

Answered by Allan on January 27, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP