Merge branch 'develop' into eshell-improvements

This commit is contained in:
Steven vanZyl 2020-05-13 09:17:10 -04:00 committed by GitHub
commit c881f98960
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
75 changed files with 1118 additions and 535 deletions

View file

@ -21,13 +21,15 @@
t))
(defun +eshell--bury-buffer (&optional dedicated-p)
(unless (switch-to-prev-buffer nil 'bury)
(switch-to-buffer (doom-fallback-buffer)))
(when (eq major-mode 'eshell-mode)
(switch-to-buffer (doom-fallback-buffer)))
(when +eshell-enable-new-shell-on-split
(when-let (win (get-buffer-window (+eshell/here)))
(set-window-dedicated-p win dedicated-p))))
(let ((directory default-directory))
(unless (switch-to-prev-buffer nil 'bury)
(switch-to-buffer (doom-fallback-buffer)))
(when (eq major-mode 'eshell-mode)
(switch-to-buffer (doom-fallback-buffer)))
(when +eshell-enable-new-shell-on-split
(let ((default-directory directory))
(when-let (win (get-buffer-window (+eshell/here t)))
(set-window-dedicated-p win dedicated-p))))))
(defun +eshell--setup-window (window &optional flag)
(when (window-live-p window)

View file

@ -187,9 +187,8 @@ You should use `set-eshell-alias!' to change this.")
;; installed for bash completion to work. How frustrating. This way we
;; can at least get bash completion whether or not fish is present.
(defadvice! +eshell--fallback-to-bash-a (&rest _)
:before-while #'fish-completion--list-completions-with-desc
(executable-find "fish")))
:before-until #'fish-completion--list-completions-with-desc
(unless (executable-find "fish") "")))
;; Activate eshell-did-you-mean using its setup function (lazily)
(use-package! eshell-did-you-mean
@ -200,4 +199,4 @@ You should use `set-eshell-alias!' to change this.")
;; work on first invocation, so we invoke it once manually by setting
;; the last command and then calling the output filter.
(setq eshell-last-command-name "catt")
(eshell-did-you-mean-output-filter "catt: command not found"))
(eshell-did-you-mean-output-filter "catt: command not found"))

View file

@ -33,7 +33,8 @@ If prefix ARG is non-nil, recreate vterm buffer in the current project's root."
(let ((buffer (get-buffer-create buffer-name)))
(with-current-buffer buffer
(unless (eq major-mode 'vterm-mode)
(vterm-mode)))
(vterm-mode))
(+vterm--change-directory-if-remote))
(pop-to-buffer buffer)))))
;;;###autoload
@ -55,7 +56,25 @@ If prefix ARG is non-nil, cd into `default-directory' instead of project root."
project-root))
display-buffer-alist)
(setenv "PROOT" project-root)
(vterm)))
(vterm)
(+vterm--change-directory-if-remote)))
(defun +vterm--change-directory-if-remote ()
"When `default-directory` is remote, use the corresponding
method to prepare vterm at the corresponding remote directory."
(when (and (featurep 'tramp)
(tramp-tramp-file-p default-directory))
(message "default-directory is %s" default-directory)
(with-parsed-tramp-file-name default-directory path
(let ((method (cadr (assoc `tramp-login-program
(assoc path-method tramp-methods)))))
(vterm-send-string
(concat method " "
(when path-user (concat path-user "@")) path-host))
(vterm-send-return)
(vterm-send-string
(concat "cd " path-localname))
(vterm-send-return)))))
(defvar +vterm--insert-point nil)

View file

@ -3,4 +3,4 @@
(package! vterm
:built-in 'prefer
:pin "e63bd65eece7c5de3a534b7e2fdbe58256ec2da0")
:pin "422ffe029b92c47e4acf0e2ed06cbc83636d7e44")