Add vterm AWS profile switch command and keybinding
Added a new function `vterm-aws-switch-profile` to switch AWS profiles in the current vterm buffer and associated it with the keybinding `C-c a` for quick access. This facilitates easier management of AWS profiles within vterm sessions.
This commit is contained in:
parent
8ad4c70070
commit
0973393714
@ -28,6 +28,15 @@
|
||||
(vterm-send-string (format "export AWS_PROFILE=%s\n" profile)))
|
||||
(setq aws-current-profile profile))
|
||||
|
||||
(defun vterm-aws-switch-profile (profile)
|
||||
"Switch the AWS profile for the current vterm command."
|
||||
(interactive (list (completing-read "Profile: " (aws-list-profiles))))
|
||||
(vterm-send-C-a)
|
||||
(vterm-send-string (format "AWS_PROFILE=%s " profile)))
|
||||
|
||||
(with-eval-after-load 'vterm
|
||||
(define-key vterm-mode-map (kbd "C-c a") #'vterm-aws-switch-profile))
|
||||
|
||||
(defun aws-sso-login ()
|
||||
(interactive)
|
||||
(let ((buffer "*aws-sso-login*"))
|
||||
|
Loading…
Reference in New Issue
Block a user