I have noticed strange behavior when using term-mode
if I kill word in termmode using shell 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-dand seeing if it reports the mapping askill-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-hookincluding 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-modeandterm-char-mode.