Skip to content

Instantly share code, notes, and snippets.

@K0HAX
Created September 16, 2016 14:56
Show Gist options
  • Save K0HAX/0b02c856449c0997b2a2d52ff2ac1bee to your computer and use it in GitHub Desktop.
Save K0HAX/0b02c856449c0997b2a2d52ff2ac1bee to your computer and use it in GitHub Desktop.
(defun ssh-to-host (x)
"Ask for host."
(interactive "sHost: ")
(let* ((buffer-name (format "*SSH %s*" x))
(buffer (get-buffer buffer-name)))
(if buffer
(switch-to-buffer buffer)
(multi-term)
(term-send-string
(get-buffer-process (rename-buffer buffer-name))
(format "ssh %s\r" x)))))
(global-set-key (kbd "M-s s") 'ssh-to-host)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment