summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.emacs.d/init.el12
1 files changed, 12 insertions, 0 deletions
diff --git a/.emacs.d/init.el b/.emacs.d/init.el
index 93f7c20..6ac9ea5 100644
--- a/.emacs.d/init.el
+++ b/.emacs.d/init.el
@@ -1382,6 +1382,18 @@ If no direction is given, don't split."
(electric-indent-mode -1)
+(defun oni:eshell-handle-url ()
+ (save-excursion
+ (goto-char eshell-last-output-start)
+ (while (re-search-forward
+ "http://[^ \n]+" eshell-last-output-end :noerror)
+ (make-button (match-beginning 0) (match-end 0)
+ 'action (lambda (button)
+ (browse-url (button-label button)))))))
+
+(stante-after esh-mode
+ (add-to-list 'eshell-output-filter-functions #'oni:eshell-handle-url))
+
(provide 'init)
;;; init.el ends here