gpt4 book ai didi

emacs - 在 Emacs 中向多个 Shell 发送命令

转载 作者:行者123 更新时间:2023-12-01 13:03:44 24 4
gpt4 key购买 nike

我希望在启动 emacs 时启动多个进程,例如一个 eshell 中的网络服务器和另一个 shell 中的 weblogic 实例,但每当我尝试向 eshell 发送命令时,Emacs 就会挂起。我也尝试过使用“交互式”命令,但 Emacs 仍然挂起。

最佳答案

(require 'cl)

(defun eshell-run (programs)
(loop for p in programs for i from 1 do
(with-current-buffer (eshell i)
(insert p)
(eshell-send-input))))

(eshell-run '("program1" "program2"))

编辑:

如果将以上几行添加到 init 文件中,最后一行列出的程序将在您启动 Emacs 时自动执行。

关于emacs - 在 Emacs 中向多个 Shell 发送命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4292377/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com