Custom shells started automatically from .emacs

2020-07-26 10:31发布

I would like to start a few shells, and set their directories from my .emacs. Opening them is easy:

;; run a few shells.
(shell "*shell5*")
(shell "*shell6*")
(shell "*shell7*")

But I would like to specify their directory, too.

2条回答
再贱就再见
2楼-- · 2020-07-26 11:09

The following works for me

(let ((default-directory "/path/to/whereever/"))
  (shell "*shell1*"))
查看更多
聊天终结者
3楼-- · 2020-07-26 11:24
(shell "*shell5*")
(with-current-buffer "*shell5*"
(goto-char (point-max))
(insert "cd dir")) ;;for example
(comint-send-input nil t) ;; enter

For now I have this, its need some improvement I think. When I use in my emacs its causes an error, but does what you want. I will try to figure why.

查看更多
登录 后发表回答