开发者

Why does C+[up,down,left,right]arrow return [A,B,C,D] in emacs -nw (terminal a.k.a. "special interface") mode? and how can I get it to stop?

开发者 https://www.devze.com 2023-01-23 11:47 出处:网络
When I open an emacs buffer in the terminal using emacs -nw C+arrow does not move me around like I would like it to.

When I open an emacs buffer in the terminal using

emacs -nw

C+arrow does not move me around like I would like it to.

Is there a way to chang开发者_运维问答e this behavior?


There are two steps to fix this.

First find out what your terminal is sending emacs. This can be done right inside emacs by hitting C-q then the combination you want to see, say C-⇒ or something.

Then in your .emacs, you can bind the combination to whatever you want. For example, if you want C-⇒ to go to the next word, you can use (global-set-key "<your combination here>" 'forward-word). Do the same for the other bindings.


I have that sometimes in combination with screen. I run emacs as a daemon -- just disconnect that screen 'window' (or is it called panel or session?) and reconnect and you should be fine.

No idea what upsets the terminal settings.

0

精彩评论

暂无评论...
验证码 换一张
取 消