开发者

emacs term kill word strange behavior

I have noticed strange behavior when using term-mode

if I kill word in termmode using sh开发者_开发问答ell shortcuts (Alt-d), word disappears, but actually does not get killed. Here is an example

andrey@localhost:~ yes no-such-file
# press Alt-d
andrey@localhost:~ no-such-file
no-such-file
no-such-file
no-such-file

rather than

andrey@localhost:~ no-such-file
bash: no-such-file: command not found

thank you


The behavior you're experiencing is the key stroke being mapped to an emacs function that acts on the buffer, rather than getting passed to the shell. You should confirm that by doing C-h k Alt-d and seeing if it reports the mapping as kill-word.

If there are keys you want to pass to the shell rather than letting emacs (term-mode) take them, add a function to the term-mode-hook including something like

(define-key term-raw-map [(meta ?d)] 'term-send-raw)

to send the raw keystroke on.

An option to remember is switching between term-line-mode and term-char-mode.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜