5

This was observed on Mac OS X 10.5, running Terminal.app. On a native Linux machine, from a bash command prompt, typing meta-backspace deletes up until the most recent whitespace. On a Mac, it sounds the system bell.

SSHing into a Linux machine with Terminal.app as the terminal causes the same problem.

This behavior is consistent with the third party application iTerm. However, the Windows program PuTTy handles meta-backspace (and other meta commands) as expected.

chicks
  • 3,793
  • 10
  • 27
  • 36
sludge
  • 332
  • 5
  • 10
  • I found an option in Terminal.app's preferences "use option as meta key" under settings icon, keyboard tab. By turning this on, I can get the functionality on the option key. Unfortunately, that's not the command key which is what I need. – sludge Jun 07 '09 at 18:49
  • The command key is special, and efforts to use it inside a terminal aren't likely to work out. Why doesn't using option work? – Bill Weiss Jun 07 '09 at 19:43
  • Because my desktop apps use command as meta key. The biggest example is Emacs. – sludge Jun 07 '09 at 19:52
  • FWIW, Using option as the meta key - option-delete (backspace) works as suggested in the question. If you change the preference you have to make a new window in order for it to take effect - it doesn't apply to open windows. – Chealion Jun 08 '09 at 00:17
  • Using the command key as meta is broken behaviour. You shouldn't try to break other apps so that they all match up. – Dan Udey Jun 12 '09 at 07:49
  • Why should using Command as Meta be any more broken than using Option as Meta? On many non-US keyboard layouts, using Option as Meta prevents you from typing various characters that you need in the shell, thereby making the terminal emulator completely unusable. Sure, using Command for this purpose makes the terminal emulator a bit clumsy to use, but at least it's useful that way. – Matthias Benkard Aug 11 '09 at 21:37
  • @Chealion wrote, “ If you change the preference you have to make a new window in order for it to take effect - it doesn't apply to open windows.” That is incorrect. Most changes to the Settings preferences take effect in all the existing terminals using that settings profile. Exceptions include a couple of the items in “Advanced” that set environment variables—they can't be altered by Terminal once the shell is started. – Chris Page Jun 27 '12 at 03:11

2 Answers2

3

The real solution to this problem is to use option as meta in the Terminal.app preferences and Emacs. In Emacs 23, I do:

(setq mac-option-modifier 'meta)

to use option as meta. Hope this helps.

chicks
  • 3,793
  • 10
  • 27
  • 36
Paul Lathrop
  • 1,608
  • 11
  • 11
  • 1
    The Emacs setting only applies if you're using a native Emacs application, not Emacs via a terminal. This question is about using programs via Terminal, so it's only necessary/useful to change the Terminal preference. – Chris Page Jun 27 '12 at 03:14
-1

You might consider using iTerm (iterm.sf.net) instead of Terminal.app... I find it's much more feature-complete than Terminal.app.

jsmith
  • 39
  • 2
  • -1 because comment litters the Internet with a software suggestion that misleads people into thinking it solves the problem. – sludge Oct 06 '15 at 01:47