'nano editor on OS X - How to type M-U for undo?

I am using nano 2.5.3 on OS X Yosemite, and I see commands at the bottom such as:

M-U Undo M-E Redo

So far, I have not been able to figure out which key or keys that M is referring to. What would be M on OS X?



Solution 1:[1]

  • There is no "UNDO" in OSX GNU nano 2.0.6.

  • Meta (M-) symbol is the Esc key in OSX. E.g. to cut text with M-T, enter Esc+T.

    The Main nano help text says:

    Escape-key sequences are notated with the Meta (M-) symbol and can be entered using either the Esc, Alt, or Meta key depending on your keyboard setup.

  • Display all key combinations while in nano by entering ctrl+G.

  • FYI: In debian's GNU nano 5.4, enter Esc+U on an OSX keyboard to "UNDO".

Solution 2:[2]

Hit ESC, then U (i.e. one after another, not together).

Note that UNDO is not supported in the default MacOS provided nano (V2.0.6) -- to get the latest version, simply do

brew install homebrew/dupes/nano

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 Wing Poon