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

feat: Add docker-container-shell-command #235

Merged
merged 1 commit into from
Sep 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions docker-container.el
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,18 @@ default directory set to workdir."
(--each (docker-utils-get-marked-items-ids)
(docker-container-vterm-env it)))

(defun docker-container-shell-command (container)
"Run exec of a CONTAINER."
(interactive (list (docker-container-read-name)))
(shell-command (read-shell-command "Run: " (format "docker exec %s " container))))

(defun docker-container-shell-command-selection ()
"Run `docker exec' on the containers selection."
(interactive)
(docker-utils-ensure-items)
(--each (docker-utils-get-marked-items-ids)
(docker-container-shell-command it)))

(docker-utils-transient-define-prefix docker-container-attach ()
"Transient for attaching to containers."
:man-page "docker-container-attach"
Expand Down Expand Up @@ -441,6 +453,7 @@ default directory set to workdir."
(docker-utils-transient-define-prefix docker-container-shells ()
"Transient for using shells on containers."
[:description docker-generic-action-description
("!" "Shell command" docker-container-shell-command-selection)
("b" "Shell" docker-container-shell-selection)
("B" "Shell with env" docker-container-shell-env-selection)
("e" "Eshell" docker-container-eshell-selection)
Expand Down