views:

37

answers:

1

In Ubuntu Jaunty the Enter key is apparently translated to Ctrl-m symbol. I'd like to free Ctrl-m symbol from newline functionality to make it available for other commands. In this case I guess I should translate Enter to newline directly. How do I do that?

I'm talking about key reassignment in gnome-terminal.

A: 

(global-set-key (kbd "<return>") 'newline)

Eric Warmenhoven
@Eric: This thing doesn't work since terminal is sending ^m code for both Enter and Ctrl-m. So these keys are indistinguishable for any program running under the terminal (e.g. Emacs). Can I make the terminal send a code different from ^m when I hit Ctrl-m?
Alex
What would you have it send? Everything else that runs in the terminal is going to expect that ^m means enter, and vice versa. Unless if you want to be hitting Ctrl-m as you're typing into your shell, I don't recommend it.
Eric Warmenhoven
A different way of interpreting your question is, instead of making it so Enter sends something other than ^m, is for Ctrl-m to send something other than ^m. Unless you can change keybindings in your terminal, you're going to have a really hard time doing that.
Eric Warmenhoven
Yep, that's want: change Ctrl+m's binding from ^m to something else.
Alex