If you use emacs
If you use emacs
Posted Dec 9, 2013 12:59 UTC (Mon) by alex (subscriber, #1355)In reply to: Fish shell 2.1 by kleptog
Parent article: Fish shell 2.1
eshell (which is a shell in elisp, rather than emacs access to the shell) can do an lot of this sort of thing. For example I have the following:
(eval-after-load "eshell"
'(progn
(defun my-eshell-kill-output ()
"Really kill (not delete) all output from interpreter since last input.
Does not delete the prompt."
(interactive)
(save-excursion
(goto-char (eshell-beginning-of-output))
(insert "*** output flushed ***\n")
(kill-region (point) (eshell-end-of-output))))
(add-hook 'eshell-mode-hook #'(lambda ()
(define-key eshell-mode-map (kbd "C-c C-o") 'my-eshell-kill-output)))))
