Power Lines Down Mac OS

Posted on  by

Mac mini (M1, 2020) MacBook Air (Retina, 13-inch, 2018 - 2019) MacBook Air (13-inch, Early 2015 - 2017). Issue: How to configure native shutdown of Mac OS X Product Line/s: Smart-UPS Back-UPS Environment: Mac OS X attached to UPS via USB cable NOTE: According to Apple, Energy Saver options are not available for UPS on portable devices e.g. MacBook, MacBook Pro, MacBook Air. See Apple discussion thread 8398176.

Updated for Mac OS X Mountain Lion 10.8.2.

In order to get page up and page down to work properly under Mac OSX Terminal, as well as the home and end of line (EoL), you need to go to Preferences and then Keyboard and configure the right escape key sequences.

(Note for laptop users: you don't have the page up/down and home/EoL keys, but you can simulate them by holding the 'fn' key and pressing on an arrow key. So these configurations also apply to you.)

In the Terminal Preferences, go to the Keyboard pane and watch the the keys named 'page up', 'page down', 'home' and 'end'. You will see they already exist but are configured to scroll the buffer rather than sending commands to the server you're connected to.

In order to change this, double click on each of the relevant lines and select Action: 'Send string to shell:'

You then need to enter the correct string to send to the shell. This is a multiple key sequence starting with the escape character (which is represented with it's octal code 033). Here are strings you can use for each key:

As of OSX 10.6.8, the correct fix is:

Power Lines Down Mac Os Catalina

KeyRecommended Escape SequenceOther possible sequences you can try if the recommended doesn't work for you
Home033OH033[1~033[H001
End033OF033[4~033[F005
Page Up033[5~
Page Down033[6~

You can either type these strings on your keyboard (start by presseing Esc) or you can just copy paste the strings from above.

It is worth noting that some of these are already bound to Shift-Page Up, Shift-Page Down, Shift-Home and Shift-End (which are obtained with Shift-Fn-Up/Down/Left/Right on a laptop keyboard). So if you can change your habits slightly you don't actually need to reconfigure anything.

Power Lines Down Mac Os Download

Also note that some people (including Apple) recommend to use 033[H for Home but this doesn't actually work in vi or vim. This is why I recommend using 033OH which has worked in any shell or editor for me so far (Mac terminal, Debian terminal, vim, etc.)

Power Lines Down Mac OS

If the recommended sequences don't work for you: please try the alternative suggested here. Also please let us know with which shell or editor you are trying to make them work and which escape sequences work best for you. This way we can order them in order of popularity and possibly give specific advice for specific environments to future visitors of this page. Thank you for your feedback.

This entry was posted by François Planque and filed under Mac stuff. Tags: howto, mac os x, terminal.