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

Using eat terminal if available #238

Open
jvillasante opened this issue Nov 5, 2024 · 6 comments
Open

Using eat terminal if available #238

jvillasante opened this issue Nov 5, 2024 · 6 comments

Comments

@jvillasante
Copy link

Currently I use vterm when available like this

(when (package-installed-p 'vterm)
        (setq docker-run-async-with-buffer-function #'docker-run-async-with-buffer-vterm))

Is there a similar setting I can use for eat terminal?

@Silex
Copy link
Owner

Silex commented Nov 5, 2024

Not yet. PR welcome 😉

@jvillasante
Copy link
Author

Looks like I don't have permissions or something?

$ git push origin eat_terminal_support
ERROR: Permission to Silex/docker.el.git denied to jvillasante.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

@jvillasante
Copy link
Author

Anyway, I don't think a PR is even needed, it works by defining the function outside docker.el. Maybe that can be added to the docs or something...

(defun my--docker-run-async-with-buffer-eat (program &rest args)
        "Execute \"PROGRAM ARGS\" and display output in a new `eat' buffer."
        (defvar eat-buffer-name)
        (defvar eat-kill-buffer-on-exit)
        (if (fboundp 'eat-other-window)
                (let* ((process-args (-remove 's-blank? (-flatten args)))
                       (eat-buffer-name (s-join " " (-insert-at 0 program process-args)))
                       (eat-kill-buffer-on-exit nil))
                    (eat-other-window eat-buffer-name args))
            (error "The eat package is not installed")))

(when (package-installed-p 'eat)
        (setq docker-run-async-with-buffer-function #'my--docker-run-async-with-buffer-eat))

@Silex
Copy link
Owner

Silex commented Nov 11, 2024

To make a PR you need to fork the repository, commit in your repository, then make a PR from your repository to this one.

If you want I'll let you do the above so you get the commit at your name, or I can also just take the code and make the commit myself. You decide.

@Silex
Copy link
Owner

Silex commented Nov 11, 2024

Btw, do you think eat should be the default, then vterm, then shell?

Is eat the globally accepted superior shell over vterm now?

@jvillasante
Copy link
Author

That's ok, you can just take the code and do the commit yourself.

I like eat since I don't need compile the module or have another dependency, vterm is still faster, so, maybe an option for the user?

In my PR I have it after vterm

(defcustom docker-run-async-with-buffer-function
    (cond ((featurep 'vterm) 'docker-run-async-with-buffer-vterm)
          ((featurep 'eat) 'docker-run-async-with-buffer-eat)
          (t 'docker-run-async-with-buffer-shell))
    "Function used to run a program with a live buffer attached to it."
    :group 'docker
    :type 'symbol)

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

No branches or pull requests

2 participants