-
Notifications
You must be signed in to change notification settings - Fork 82
Open
Description
Hi - I don't see an obvious way to create a term buffer instead of a shell buffer.. so I wrote the below. Let me know if there is a better way, or if you would like me to submit a PR.
(require 'docker-containers)
(docker-utils-define-popup docker-containers-term-popup
"Popup for doing M-x `term' to containers."
'docker-containers-popups
:actions '((?a "Term" docker-containers-term-selection)))
(define-key docker-containers-mode-map "a" 'docker-containers-term-popup)
(defun docker-containers-term-selection ()
"Run `docker-container-term' on the containers selection."
(interactive)
(--each (docker-utils-get-marked-items-ids)
(docker-container-term it)))
(defun docker-container-term (container)
(interactive (list (docker-read-container-name "container: ")))
(let ((name (format "*term (docker/%s)*" container)))
(term "/bin/bash")
(rename-buffer name)
(insert (format "docker exec -it %s bash" container))
(term-send-input)))
Metadata
Metadata
Assignees
Labels
No labels