
我嘗試將此片段添加到我的 中~/.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*")))