我想打开一个cmd.exe窗口,其项目根目录是当前目录.
这是我的elisp代码:
(defun open-cmd-and-cd-to-project-root()
(interactive)
(projectile-mode t)
(cd (projectile-get-project-root))
(shell))
Run Code Online (Sandbox Code Playgroud)
它在Emacs缓冲区中打开一个cmd shell.但我希望它打开一个在Windows中运行的新的本机cmd.exe窗口,而不是在Emacs中运行的缓冲区.我怎样才能做到这一点?
做这个:
(let ((proc (start-process "cmd" nil "cmd.exe" "/C" "start" "cmd.exe")))
(set-process-query-on-exit-flag proc nil))
Run Code Online (Sandbox Code Playgroud)
该set-process-query-on-exit-flag给nil的,所以它不会在关闭打扰emacs(我们不能反正杀死它).
| 归档时间: |
|
| 查看次数: |
1517 次 |
| 最近记录: |