• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Jeff Mikels

…biblical Christianity without conservative idolatry…

  • Home
  • All My Sermons
  • My Blog
    • Longer Articles
    • Christian Leadership
    • Spiritual Health
    • Tough Questions
    • Geekery
    • All Posts
  • About Me
    • My Books
    • My Church
    • FAQ
  • Show Search
Hide Search
Home/Geekery/HOW TO: Fix “Home” and “End” keys in the Mac Terminal

HOW TO: Fix “Home” and “End” keys in the Mac Terminal

The Mac Terminal.app is one of the best Terminals I have used, but it has some annoying quirks like not supporting standard key definitions out of the box. The most frustrating ones are Home and End.

In nearly every OS, Home has meant “go to the beginning of the line” and End has meant “go to the end of the line,” but on the Mac, the default has always been for Home to scroll a document up to the top and for End to scroll the document down to the bottom.

However, since most Terminal applications aim for the Unixy world, they don’t care about scrolling through documents as much as dealing with the line you are on.

Luckily, the Mac Terminal has the ability to let the intrepid user customize it’s keybindings. If you want to make your Terminal operate like a standard Unix-like terminal, follow these simple steps:

  • Open the Terminal app.
  • Select Preferences from the Terminal Menu.
  • Under Settings, select a Profile you want to change.
  • In the right pane, select the Keyboard button to see keyboard settings.
  • Select the line that has the word “home” in the “Key” column.
  • Click the Edit Button at the bottom.
  • Make it look like this:

Screen Shot 2013-08-23 at 10.46.57 AM

  • To enter the right key code, clear the box and type these keys in order: ESCAPE O H (that’s a capital letter o, not a zero)
  • The right key code for “end” is exactly like “home” but you replace the “H” with an “F”.

Some Linux/Unix Friendly Keycodes (submit your own in the comments):

  • home :: \033OH
  • end :: \033OF
  • F1 :: \033[11~
  • F2 :: \033[12~
  • F3 :: \033[13~
  • F4 :: \033[14~

Other links that worked but had problems:

The main problem with each solution below is that they only work part of the time. My solution above is compatible with the latest version of Mac OS X (Mountain Lion), and is also the default key binding for xterm, remote shells (ssh), vi(m), and also GNU screen. Each of the solutions below only work in a few of the cases for me.

  • Fix the OS X Terminal
  • Keybindings for the whole OS
  • Didn’t work for me
  • Another Solution

Written by:
Jeff Mikels
Published on:
August 23, 2013
Thoughts:
12 Comments

Categories: Geekery

Previous Post: « Why does God listen to my prayer?
Next Post: Tough Decisions »

Reader Interactions

Comments

  1. vitb

    January 14, 2016 at 6:53 am

    Hey man, it worked 🙂 Thanks a lot for recipe than works even for Vim in Terminal.app. Great!

    Reply
  2. JThott

    April 15, 2020 at 1:35 pm

    Hey,

    Thanks a lot. It worked like a charm!

    Reply
  3. Kanishka Dutta

    July 29, 2020 at 3:52 am

    Thank you for sharing this.
    Works for me.

    Reply
  4. dood

    August 5, 2020 at 12:08 pm

    this doesn’t work in mojave. there is no longer a ‘send string to shell’ option for the action.

    Reply
  5. Scott

    August 12, 2020 at 7:22 pm

    Just use the send text option and it works fine, confirmed in Catalina as well.

    Reply
  6. mai ling

    January 7, 2021 at 5:46 pm

    can you make home and end macos-wide function sanely like on linux and windows?

    Reply
  7. Ahti

    September 20, 2021 at 2:16 am

    Thanks a lot Jeff! Works like a charm on Big Sur.

    Reply
  8. Utsav

    February 24, 2022 at 8:43 pm

    This worked!

    Reply
  9. Jason

    March 11, 2022 at 4:20 pm

    Thank you for this, I know its old but it worked like a charm.

    Reply
  10. Steve

    March 25, 2022 at 2:28 pm

    For anyone using the vi key bindings (bindkey -v) in their shell, change the mappings to Home (0) and End ($). That is a zero, not a letter O.

    Reply
  11. Steve

    March 25, 2022 at 2:29 pm

    My previous comment didn’t escape my angle brackets correctly. That should be Escape+0 and Escape+$.

    Reply
  12. Ricardo Montañana

    December 16, 2024 at 7:32 am

    Thank you very much!!!

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Articles

Dear Christian Conservative: Vote Your Conscience

Today is Super Tuesday meaning that a large number of states are having their primaries for the Presidential election. Currently, for …

Continue Reading about Dear Christian Conservative: Vote Your Conscience

Let’s Talk about Salvation: Part 2

Salvation and Forgiveness in the Gospel of John In my previous post, I considered a large number of passages in the synoptic gospels (Matthew, …

Continue Reading about Let’s Talk about Salvation: Part 2

Let’s Talk About Salvation and Forgiveness: Part 1

I've been thinking a lot about this idea recently: What would it look like if we were as eager to forgive as Jesus was? This is a tough …

Continue Reading about Let’s Talk About Salvation and Forgiveness: Part 1

Evangelical Idolatry

I've been going through a dilemma. The question on my mind is this: How do I talk about my book with people who don't know me all that …

Continue Reading about Evangelical Idolatry

Explore more

Footer

About Me

Jeff Mikels • 765-404-0807

Copyright © 2025 · Log in

  • Home
  • Blog
  • About Me
  • FAQ
  • Contact