kyu <kyu / console-pimps.org> writes:

> One feature i find vi/nvi/vim/whatever is lacking is the ability to
> have an interactive shell inside a buffer, i can be in
> one xemacs session, and C-X2-C-Xo m-x shell and i have a command

That's scary. Try this instead:

(defvar ys::eshell-wins nil)
(global-set-key "\C-cs" (lambda (win-num)
			  (interactive "p")
			  (message "win-num %s" win-num)
			  (let ((assoc-buffer (cdr (assoc win-num ys::eshell-wins))))
			    (if (not (buffer-live-p assoc-buffer))
				(progn ; the requested buffer not there 
				  (setq assoc-buffer (eshell t))
				  (setq ys::eshell-wins (assq-delete-all win-num ys::eshell-wins))
				  (add-to-list 'ys::eshell-wins (cons win-num assoc-buffer))))
			    (switch-to-buffer assoc-buffer)
			    (rename-buffer (concat "*eshell-" (int-to-string win-num) "*"))
			    assoc-buffer)))


To open shell #1: C-1 C-c s   or if your environment doesn't transmit
C-<number> (like from a putty session), then use M-1 C-c s    or   the traditional  C-u 1 C-c s 

Shell #2: C-2 C-c s or M-2 C-c s or C-u 2 C-c s

and so on.

YS.