2010-03-29 62 views

回答

12

你可以這樣做:

`C-u M-x eshell` 

這將*eshell**eshell*<2>,等創建。

4

eshell的docstring聲明「非數字前綴arg表示創建新會話」。我一遍又一遍地鍵入M-- M-x eshell,並且每次打開一個新的eshell緩衝區。

+1

C-U m的-X ESHELL工作過。 – ataylor 2010-03-29 20:35:30

+0

該死的。當我開始我的回答時,你的評論沒有被寫入:) – 2010-03-29 20:56:14

6

我的首選的方法是創建一個名爲彈:

(defun make-shell (name) 
    "Create a shell buffer named NAME." 
    (interactive "sName: ") 
    (setq name (concat "$" name)) 
    (eshell) 
    (rename-buffer name)) 

是要點。然後M-x make-shell name將創建所需的外殼。

0

啓動GNU屏幕是採用了ANSI長期

1

銅的Mx ESHELL的偉大工程的另一種選擇,但我更喜歡叫貝殼 - make-shell方法,切換緩衝區

0

Mybe時是很有用的,下面的解決方案更好。因爲eshell緩衝區由eshell-buffer-name的值決定。您不需要重命名緩衝區。

(defun buffer-exists (bufname) 
    (not (eq nil (get-buffer bufname)))) 

(defun make-shell (name) 
    "Create a shell buffer named NAME." 
    (interactive "sName: ") 
    (if (buffer-exists "*eshell*") 
     (setq eshell-buffer-name name) 
    (message "eshell doesnot exists, use the default name: *eshell*")) 
    (eshell)) 
0

擴展在make-eshell,這將創建一個ESHELL附加的下一個計數器,所以它就像eshell1eshell2等:

(lexical-let ((count 1)) 
    (defun make-eshell-next-number() 
    (interactive) 
    (eshell) 
    (rename-buffer (concat "*eshell" (number-to-string count) "*")) 
    (setq count (1+ count))))