Skip to content

Commit

Permalink
Make vterm option in kubel-exec-pod opt-in (#100)
Browse files Browse the repository at this point in the history
* Silence warning about misplaced interactive spec

In kubel-exec-vterm-pod:
kubel.el:939:4: Warning: misplaced interactive spec: ‘(interactive)’

* Make vterm option in kubel-exec-pop opt-in
  • Loading branch information
PuercoPop authored Sep 9, 2022
1 parent 4c80c74 commit 7237369
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,21 @@ Get it from Melpa, or copy and load the `kubel.el` file.
If you want to have the evil compatibility package, get it from Melpa as well or
load the `kubel-evil.el` file.

# Setup

```elisp
(require 'kubel)
(kubel-vterm-setup) ; If you wish to have vterm as an option when using exec
```

Or if one uses `use-package`

```elisp
(use-package kubel
:after (vterm)
:config (kubel-vterm-setup))
```

## Usage

To list the pods in your current context and namespace, call
Expand Down
9 changes: 7 additions & 2 deletions kubel.el
Original file line number Diff line number Diff line change
Expand Up @@ -990,7 +990,6 @@ P can be a single number or a localhost:container port pair."

(defun kubel-exec-vterm-pod ()
"Exec into the pod under the cursor -> vterm."
(require 'vterm)
(interactive)
(kubel-setup-tramp)
(let* ((dir-prefix (kubel--dir-prefix))
Expand All @@ -1002,6 +1001,13 @@ P can be a single number or a localhost:container port pair."
(vterm-shell "/bin/sh"))
(vterm)))

;;;###autoload
(defun kubel-vterm-setup ()
"Adds a vterm enty to the KUBEL-EXEC-POP."
(require 'vterm)
(transient-append-suffix 'kubel-exec-popup "e"
'("v" "Vterm" kubel-exec-vterm-pod)))

(defun kubel-exec-ansi-term-pod ()
"Exec into the pod under the cursor -> `ansi-term'."
(interactive)
Expand Down Expand Up @@ -1163,7 +1169,6 @@ RESET is to be called if the search is nil after the first attempt."
("!" "Shell command" kubel-exec-pod-by-shell-command)
("d" "Dired" kubel-exec-pod)
("e" "Eshell" kubel-exec-eshell-pod)
("v" "Vterm" kubel-exec-vterm-pod)
("a" "Ansi-term" kubel-exec-ansi-term-pod)
("s" "Shell" kubel-exec-shell-pod)])

Expand Down

0 comments on commit 7237369

Please sign in to comment.