There is a (projectile-run-term PROGRAM) (accessible using C-c p x t) which opens term in project root. Would be great if there was such integration with vterm (emacs-libvterm).
@Compro-Prasad: not related to this issue, but can you explain in a few words what vterm's advantages are? Its homepage contains very little information.
Vterm is a terminal emulator available only when Emacs is built with modules support. It is a far better terminal emulator than the builtin term. Its faster and there are relatively lower number of lags(slowdowns) when interacting with it.
Thanks for the information :+1:
I noticed there are multiple projectile-run- functions and they are specific to different term emulators inside Emacs (the defaults, at least).
I also use vterm but I would suggest to make a custom function in your configuration for this, since vterm is not a default Emacs term emulator.
Something like this should work: (Note: switches to vterm buffer if exists and has the default name. If not, it will create a new vterm. Also, I hadn't test this heavily)
(defun projectile-run-vterm ()
(interactive)
(let* ((project (projectile-ensure-project (projectile-project-root)))
(buffer "vterm"))
(require 'vterm)
(if (buffer-live-p (get-buffer buffer))
(switch-to-buffer buffer)
(vterm))
(vterm-send-string (concat "cd " project))
(vterm-send-return)))
@elnawe's suggestion works well, all you need to to bind it to a keymap. Also, vterm is awesome, I might start using the terminal inside emacs.
I agree, vterm is great. It works like any X Term emulator but has some great Emacs keybindings like C-c C-t to select and copy text. I use EXWM so vterm for me is the best term emulator since I don't need to emulate keybindings.
@elnawe: made a PR based on your code
Most helpful comment
@elnawe: made a PR based on your code