Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I use GNU Emacs, usually like emacs -nw which launches the terminal version (as opposed to the windowed GUI version).

I write school papers in LaTeX so I use flyspell-mode for spell-checking within emacs. This works fine in the GUI version, but in a terminal, I run into issues with the keystroke C-. (Ctrl-.). In a tty, this does nothing, and in terminator or gnome-terminal, this simply inputs a ".".

What can I do to make it do what it does in the windowed version (show spelling suggestions for a misspelled word)?

EDIT: In case this matters, I am using Ubuntu 12.04 with Emacs 23.3.1 (which I believe is default from the 12.04 repo).

share|improve this question
Same here. Did you try Esc-x flyspell-mode? This works for me. – Masroor Feb 18 '13 at 4:55
Well, yes. I always start flyspell-mode with M-x, but ESC x does not seem to make a difference. – cg505 Feb 18 '13 at 13:40
Same here. However I found a default keybinding that works for both versions ESC-TAB. – McNisse Mar 20 '13 at 20:36
Yeah, ESC TAB or M-TAB both work for me. Thanks for the tip @McNisse. – cg505 Mar 20 '13 at 23:42
up vote 2 down vote accepted

It looks like the important part of this question was already answered in the comments, but to address the root cause in case you're curious, I think ctrl-. doesn't work in a terminal because of some limitations of terminal emulators. In a standard terminal, ctrl is defined to send the ASCII code of the key you press minus 64 (this is why ctrl-J (74) sends newline (10) and ctrl-I (73) sends tab (9), for example). Since the period's ASCII code is 46, subtracting 64 would give -18, which is invalid because it's negative and there are no negative ASCII codes and therefore nothing for emacs to receive and understand.

When you run emacs in windowed mode, the terminal emulator mechanism is bypassed and instead the more robust keyboard handling of X11 is used, which can handle more obscure keystrokes (rather than reducing each keystroke down to one ASCII character, the program receives the original key plus all applicable modifiers, separately). So it's probably impossible to make tty-based emacs handle ctrl-. unless you make custom modifications to your terminal emulator (and probably also emacs).

share|improve this answer
This answer is really interesting. I dug into deeper, and found out DEC VT100 works similar but differently, strictly speaking. Here is what it does when control key and other key are pressed together: 1) lookup ASCII table by keyboard scan code 2) lookup the table of valid control codes by the ASCII 3) if it's valid, mask bit5 and bit6 of the ASCII 4) send out. So ctrl-J, ctrl-j, and ctrl-* could all send out LF but the validity check limited the combinations. See DEC VT100 technical manual section 4-43 (PDF page 93). – Kenji Noguchi Feb 12 at 20:12

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.