Sammanfattning: Added Eshell's native multi-shell support
> == Native Eshell ==
> Eshell itself can open a specific new buffer when invoked as (eshell 'N) where N is a positive integer. When invoked as (eshell 'Z) where Z is not a positive integer, it will open the next sequential free shell number.
It is sometimes annoying to use multiple shells from within emacs. One must create a shell, rename it, create another, etc.
Eshell itself can open a specific new buffer when invoked as (eshell ‘N) where N is a positive integer. When invoked as (eshell ‘Z) where Z is not a positive integer, it will open the next sequential free shell number.
shell-switcher is an emacs minor mode to easily switch between shell buffers (like with alt+tab). It works with eshell and any other shell.
Check the screencast!
multi-eshell.el exists. It maintains a ring of shell buffers, and has 3 useful functions:
multi-eshell – Creates a NEW shell and switches to it, even if one already exists.
multi-eshell-switch – If not in a shell buffer, return to the last EXISTING shell buffer. Otherwise, switch to the next buffer in the shell ring.
multi-eshell-go-back – Switch to the previous buffer in the shell ring.
Q: What advantages does this provide over using M-x eshell-new along with various buffer switching techniques?
A: Convenience, nothing more. One-button cycling through eshell buffers can be faster than C-x b eshell<2> (especially if you don’t remember which eshell<?> you want to switch to). Also, is eshell-new part of emacs? It doesn’t appear to be in 22.1.50 (of Carbon emacs).
multi-eshell-function calls multi-eshell-shell-function that may change default-directory (the shell command does that). Thus, when wanting to start a new shell with multi-eshell-shell-function=shell, the new shell will be started in the same directory than the previous shell while it would make more sense to launch it in the default-directory where the multi-eshell was launched. This should fix this issues :
--- b/multi-eshell.el +++ a/multi-eshell.el @@ -45,7 +45,16 @@ :type 'string :group 'multi-eshell) -(defun multi-eshell-function () "This function opens the appropriate shell." (eval multi-eshell-shell-function) ) +(defun multi-eshell-function () + "This function opens the appropriate shell and restores the default-directory +after" + (let( + (cur_dir default-directory) + ) + (eval multi-eshell-shell-function) + (setq default-directory cur_dir) + ) +) ;;;(defvar multi-eshell-function `(shell) ) ;;; Defines the shell. ('shell) or ('eshell) ;(defvar multi-eshell-name "*eshell*") ;;; Name of default shell or eshell buffer