当与之关联的进程结束时,如何自动终止终端缓冲区。
问问题
948 次
2 回答
6
我发现了更简单的方法,定义了一个建议term-handle-exit
(defadvice term-handle-exit
(after term-kill-buffer-on-exit activate)
(kill-buffer))
于 2014-05-16T02:16:09.223 回答
1
我发现我可以为此使用进程哨兵并将其设置为term-exec-hook
(add-hook 'term-exec-hook (lambda ()
(let* ((buff (current-buffer))
(proc (get-buffer-process buff)))
(lexical-let ((buff buff))
(set-process-sentinel proc (lambda (process event)
(if (string= event "finished\n")
(kill-buffer buff))))))))
于 2012-09-27T15:24:42.167 回答