Emacs: 실행 시 하단 창에서 쉘을 분할하고 여는 방법은 무엇입니까?

Emacs: 실행 시 하단 창에서 쉘을 분할하고 여는 방법은 무엇입니까?

이 조각을 내 에 추가하려고 시도했지만 ~/.emacs결과 버퍼/창 매핑이 이상합니다.

;; Open split shell on launch
(add-hook 'after-init-hook
  (lambda ()
    (let ((w (split-window-below 2)))
      (select-window w)
      (sh))
      (switch-to-buffer "*shell*")))

예:

$ emacs .

예상되는:

  • 상단 창문이 어두워졌습니다
  • 하단 창은 쉘입니다

관찰됨:

  • 위쪽 창문이 긁혔어요
  • 아래쪽 창문이 어두워졌어

답변1

@lawlist에게 감사드립니다:

;; Open split shell on launch
(add-hook 'emacs-startup-hook
  (lambda ()
    (let ((w (split-window-below 2)))
      (select-window w)
      (sh))
      (switch-to-buffer "*shell*")))

관련 정보