Skip to content

Instantly share code, notes, and snippets.

@oantolin
Created September 7, 2021 05:44
Show Gist options
  • Save oantolin/0fdfcdf00a10b1746a7dcc233d0d8b19 to your computer and use it in GitHub Desktop.
Save oantolin/0fdfcdf00a10b1746a7dcc233d0d8b19 to your computer and use it in GitHub Desktop.
;; -*- lexical-binding: t; -*-
;; to use run: emacs --batch -l standalone-eshell.el
(require 'em-prompt)
(let ((dir default-directory))
(add-hook 'eshell-directory-change-hook
(lambda () (setq dir default-directory)))
(while t
(let* ((default-directory dir)
(command (read-from-minibuffer (funcall eshell-prompt-function))))
(princ (eshell-command-result command)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment