Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add processes UI #96

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Conversation

Grimpper
Copy link
Contributor

@Grimpper Grimpper commented Jan 2, 2025

Hello!

This PR adds a vtable based process UI to display asynchronous running process created by envrc.

It provides a few keybindings, envrc-list-mode-map, for interacting with the processes. For now it allows:

  • k: kill the process of the current line
  • RET: follow the element under point, PID, path or buffer. Following the PID opens a proced showing the selected process and it's children in a tree form (this can be seen in the image below.
  • g: for refreshing the table

The module also provides envrc-list-auto-update-flag which periodically refreshes the envrc process UI every envrc-list-auto-update-interval

This is how it looks:
image

I hope this makes the asynchronous interface easier to use for the user.

Regards,
Sergio.

If needed, checking if the envrc directory is allowed, can be implemented with
the following procedures:
```
(defun envrc--allowed-p (env-dir)
  "Return TRUE if ENV-DIR is blocked."
  (let ((allow-hash (envrc--find-allow-hash env-dir))
        (deny-path (concat (or (getenv "XDG_DATA_HOME")
                               (concat (getenv "HOME") "/.local/share"))
                           "/direnv/allow")))
      (locate-file allow-hash
                   (list deny-path))))

(defun envrc--allowed-p (env-dir)
  "Return TRUE if ENV-DIR is blocked."
  (let ((allow-hash (envrc--find-allow-hash env-dir))
        (deny-path (concat (or (getenv "XDG_DATA_HOME")
                               (concat (getenv "HOME") "/.local/share"))
                           "/direnv/allow")))
      (locate-file allow-hash
                   (list deny-path))))
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant