簡體   English   中英

是否有直接的elisp方法來檢查進程是否在emacs術語緩沖區中運行?

[英]Is there a direct elisp way to check if a process is running in an emacs term buffer?

我需要檢查一個進程是否仍在我的emacs術語中運行; (term "/bin/bsh") ,然后重命名為,例如。 term-A

我已經嘗試過(term-check-proc "term-A") ,但它沒有顯示我需要什么,或者至少,我看不出如何使用它。

如果有多個emacs term處於活動狀態且運行相同的程序(在我的情況下,很可能),試圖通過shell調用ps afx (或類似命令)來追逐它是有問題的......

我真的需要知道特定emacs術語緩沖區term-A的進程是否正在運行。

您可以使用get-buffer-process

(get-buffer-process "*shell*") -> #<process shell>
(get-buffer-process "*scratch*") -> nil

*shell*退出shell之后,我也得到了該緩沖區的nil

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM