我的init.el中有以下代码
;;open eshell
(defun eshell-other-window ()
(interactive)
(let ((buf (eshell)))
(switch-to-buffer (other-buffer buf))
(switch-to-buffer-other-window buf)
)
)
(global-set-key (kbd "C-t") 'eshell-other-window)在我退出eshell之前,它工作得很好。当我退出时,窗口保持打开状态。如何让窗口自动关闭?
发布于 2018-08-16 08:04:19
下面的答案假设用户在*Eshell*缓冲区的命令提示符下输入exit,然后按return/enter键,并且该答案假定函数eshell/exit正在执行其操作。用户仍然可以自由地自定义变量eshell-kill-on-exit,以便在退出时掩埋或终止*Eshell*缓冲区。
(require 'eshell)
(defun my-custom-func ()
(when (not (one-window-p))
(delete-window)))
(advice-add 'eshell-life-is-too-much :after 'my-custom-func)https://stackoverflow.com/questions/51867693
复制相似问题