2010-03-29 16 views

Odpowiedz

12

Można to zrobić:

`C-u M-x eshell` 

To stworzy *eshell*, *eshell*<2>, i tak dalej.

4

Dokumentacja eshell stwierdza, że ​​"Niepilny prefiks arg oznacza utworzenie nowej sesji." Wpisałem M-- M-x eshell w kółko i za każdym razem, gdy otwierałem nowy bufor eshell.

+1

C-u M-x eshell działa zbyt. – ataylor

+0

Cholera. Twój komentarz nie został napisany, kiedy zacząłem swoją odpowiedź :) –

6

Mój preferowanym podejściem jest stworzenie o nazwie muszle:

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

jest sedno. Następnie M-x make-shell name utworzy żądaną powłokę.

0

Wywoływanie GNU ekran jest inna opcja dla tych, używając ANSI termin

1

Cu Mx eshell działa świetnie, ale wolę nazwanych muszle - make-shell podejście jest przydatne podczas przełączania buforów

0

Mybe następujące rozwiązanie lepszy. Ponieważ bufor eshell jest określony przez wartość eshell-buffer-name. Nie musisz zmieniać nazwy bufora.

(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

Rozszerzając make-eshell tworzy to eshell dołączenie następnego licznika, tak jak to jest eshell1, eshell2 itp .:

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