Hot answers tagged

3

Start with Eshell: (setq initial-buffer-choice #'eshell) Start with running Bash in Term: (setq initial-buffer-choice (lambda () (term "bash"))) C-h v initial-buffer-choice If the value is a function, call it with no arguments and switch to the buffer that it returns.


3

The Elisp code below makes ls output of eshell clickable. It is basing on a method proposed on emacswiki. If you click the mouse-button-2 (e.g., the middle mouse button/scroll-wheel) you get a pop up menu offering you to find the file in Emacs, to copy the file path, or to copy the path of the containing directory. (require 'em-ls) (require 'easymenu) (...


3

For exa in eshell you can just use the following alias. It is preserved over a restart of Emacs. alias exa *exa --color=always The general problem to teach other programs about the color capabilities of the comint of Emacs is described on Rededit. This approach helps for an example colorizing git output under Eshell. Lax Citation: Create a file ~/....


2

Running clear with 1, as in clear 1 works. . How could you have found this out? We know we want to look for a function about eshell and it has to do with clear. So, why not do C-h f and type eshell clear. This produces two functions: eshell/clear-scrollback eshell/clear If we select eshell-scrollback, Emacs shows us usage: eshell/clear-scrollback is a ...


2

The command to change from one window to another as you describe is other-window which is bound to C-x o by default.


2

I then tried various sorts of C-h and websearch, without success. Please check the manual first! (or second, after docstrings) (eshell) Dollars Expansion: Eshell has different ‘$’ expansion syntax from other shells. There are some similarities, but don’t let these lull you into a false sense of familiarity. [...] ‘${command}’ Returns the output of ‘...


2

This isn't so much an answer, as a clue for someone else... When I run emacs -Q followed by M-x eshell and do: Welcome to the Emacs shell ~ $ python3 Python 3.7.2 (default, Jan 13 2019, 12:50:15) [Clang 10.0.0 (clang-1000.11.45.5)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import pdb >>> pdb....


1

You can use M-| (shell-command-on-region). Within eshell, you can use ~ $ (with-current-buffer "*scratch*" (buffer-string)) | nl 1 ;; This buffer is for text that is not saved, and for Lisp evaluation. 2 ;; To create a file, visit it with <open> and enter text in its buffer. ~ $ Eshell commands are Emacs functions, e.g,. (defun kitty ...


1

You can clear the bindings for the cursor keys in eshell-mode with the following Elisp snippet in your init file. (defun my-eshell-config () "My Eshell configuration." (define-key eshell-mode-map (kbd "<up>") nil) (define-key eshell-mode-map (kbd "<down>") nil)) (add-hook 'eshell-mode-hook #'my-eshell-config) Only the prompt echoes are ...


1

Looks like Emacs cannot find the external grep tool and uses its internal eshell-poor-mans-grep. It interprets the first argument as expression and all other arguments as files. Here is the doc string of poor-mans-grep which pityingly does not clarify the arguments: eshell-poor-mans-grep is a compiled Lisp function in ‘em-unix.el’. (eshell-poor-...


1

You can copy the following Elisp code to your init files. It contains a modified version of function eshell-source-file. Essentially I changed (insert-file-contents file) to (insert string). Furthermore I needed a minor modification of 'eshell-command-name. It also contains the function define-eshell-script defining an Eshell command with a doc string and ...


1

I cycle using comint-previous-input and comint-next-input. So, if I had entered previously x = 1 and x = 2; when I enter x = [cursor] the above two comint commands cycle the previous entries backward and forward. But it won't go back to x = as it is not in the history. You can just kill to the end of line at any point to get x = again.


1

As pointed out by @npostavs in a comment underneath the original question, the following solution proposed by the original poster should work -- at least in a current version of Emacs that is -- tested with Emacs 26.1: (defun eshell/ff (&rest args) (apply #'find-file args)) Alternative Solution: (defun eshell-add-aliases () "Doc-string." (...


Only top voted, non community-wiki answers of a minimum length are eligible