Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8017975
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T20:59:54+00:00 2026-06-04T20:59:54+00:00

I have just switched from using Emacs.app to emacs server and emacsclient in terminal

  • 0

I have just switched from using Emacs.app to emacs server and emacsclient in terminal mode using iterm2 as my terminal emulator. I am having some trouble with some keybindings though. Particularly M-left arrow prints the character D, M-right arrow prints C, M-up arrow prints A, and M-down arrow prints B. M-ret seems to work though, at least for org mode. I am using the xterm defaults for keys in iterm2 and have the left and right option keys bound to +Esc. I can get the M-left functionality in org-mode with Esc-left or Esc-right This is particularly annoying in org-mode. Am I going to have to just rebind the keys in my .emacs? How would I go about doing that?

I have looked at this http://orgmode.org/manual/TTY-keys.html#TTY-keys, but I don’t understand why the arrow keys should be unavailable in the terminal.

edit:

Cat meta-up: ^[[1;9A
Cat meta-down: ^[[1;9B
Cat meta-right: ^[[1;9C
Cat meta-left: ^[[1;9D

Main problem solved, but I am now having trouble with shift-up. "<select> undefined". I tried a similar mapping with the escape sequence I got from cat: ^[[1;2A. Reluctant to create another question for a similar problem.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T20:59:55+00:00Added an answer on June 4, 2026 at 8:59 pm

    Solution 1

    Based on the info you provided, here’s one thing you can try. You tell emacs to map those escape sequences to the proper key sequences:

    (add-hook 'term-setup-hook
      (lambda ()
        (define-key function-key-map "\e[1;9A" [M-up])
        (define-key function-key-map "\e[1;9B" [M-down])
        (define-key function-key-map "\e[1;9C" [M-right])
        (define-key function-key-map "\e[1;9D" [M-left])))
    

    Solution 2

    I also found another possible solution with a little googling: redefine the iTerm bindings instead, to match what emacs is looking for.

    http://offbytwo.com/2012/01/15/emacs-plus-paredit-under-terminal.html

    Quote from the above page:

    Go back to the profile key bindings under iTerm2 and add bindings for the following:

    M-up      : Esc-[1;4A
    M-down    : Esc-[1;4B
    M-right   : Esc-[1;4C
    M-left    : Esc-[1;4D
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just switched from svn to mercurial and have read some tutorials about
I have just switched over from the old png transparency fix using a htc
In order to do some multi-platform GUI development, I have just switched from GTK
I just switched from using Passenger to using POW because I didn't have to
I have just started using xcode 4.3.2 on lion (switched from snow leopard) and
I have just switched to rails from padrino/sinatra so the routing stuff puzzles me.
I've just switched from radrails to netbeans. So far, so good. But I have
I have just switched from VB.Net to C# and am writing a windows application.
I've just switched over to using ADODB with MySQL and PHP... I'm having troubles
I'm in a programming class where we have just switched from python to C.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.