From 9e7b8236df45e04a8468353858fdf2d5ddd27ec0 Mon Sep 17 00:00:00 2001 From: Alfonso Cobo Canela <165585176+cobcan@users.noreply.github.com> Date: Fri, 16 Aug 2024 01:46:32 +0200 Subject: [PATCH] add new plugin current-ctx-terminal (#2795) Co-authored-by: acobo --- plugins/current-ctx-terminal.yaml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 plugins/current-ctx-terminal.yaml diff --git a/plugins/current-ctx-terminal.yaml b/plugins/current-ctx-terminal.yaml new file mode 100644 index 00000000..668a7ab4 --- /dev/null +++ b/plugins/current-ctx-terminal.yaml @@ -0,0 +1,16 @@ +plugins: + open-terminal: + shortCut: Ctrl-T + confirm: false + description: Open a terminal in the current context + scopes: + - all + command: /usr/bin/sh + background: false + args: + - -c + - bash -c "kubectl config use-context $CONTEXT && echo -e \"\e[1;42mk9s bash terminal.\nCtrl + d or 'exit' to go back to k9s\e[0m\" && bash" + # New window for terminal can be opened with any emulator + #- x-terminal-emulator -e bash -c "kubectl config use-context $CONTEXT && echo -e \"\e[1;42mk9s bash terminal.\nCtrl + d or 'exit' to go back to k9s\e[0m\" && bash" + # example with tilix: + #- tilix -e bash -c "kubectl config use-context $CONTEXT && echo -e \"\e[1;42mk9s bash terminal.\nCtrl + d or 'exit' to go back to k9s\e[0m\" && bash" \ No newline at end of file