I use M-x term
as my primary shell in emacs. However, unlike M-x shell
, view-lossage
will still store my keystroke if my password is prompted. After some search, it looks like there is no way to stop view-lossage
recording when prompted.
I would like to know, is it possible to disable it completely ? How can I workaround this problem ?
recent-keys
is a C function, so it looks like you'll need to re-compile Emacs.
keyboard.c
:
#define NUM_RECENT_KEYS (300)
Just change 300 to 0 and you're done.
I figure out a way to workaround the problem, using the clear-this-command-keys
function mentioned in @Sean's comment.
Basic idea is to "clear recorded keys when key is send" by advising term-send-raw
, I call clear-this-command-keys
whenever enter is pressed.
(defadvice term-send-raw (after clear-recorded-key activate)
(if (string= (kbd "RET") (this-command-keys))
(clear-this-command-keys)))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With