如何让特定的命令不保存在eshell history中

来源:互联网 发布:单片机软件工程师岗位 编辑:程序博客网 时间:2024/06/05 21:58

如何让特定的命令不保存在eshell history中

通过设置变量`eshell-input-filter’可以实现这一目的.

`eshell-input-filter’的值应该是一个判断函数,该函数接受eshell input作为参数,若该函数返回nil值,则表示该eshell input不会被记录在history中,否则记录在history中.

下面是一个从reddit中摘录的配置,用来设置所有以空格开头的eshell input都不记入history中

    (setq eshell-input-filter          (lambda (str)            (not (or (string= "" str)                     (string-prefix-p " " str)))))
0 0
原创粉丝点击