emacs-libvterm
emacs-libvterm copied to clipboard
Add a fallback shell command
This commit introduces a new defcustom that configures a fallback shell executable which is used if the selected shell (e.g. vterm-shell) is not executable.
The fallback is especially useful if the vterm is opened on a remote host over ssh/tramp which does not have the configured vterm-shell installed, but the user does not want to configure a different shell for all ssh hosts, as some may have the shell in vterm-shell installed.
This is my suggestion in response to running into #567.
I have only tested my solution on my local machine (by configuring vterm-shell to something invalid).
This change introduces breaking behavior as adding command line arguments to vterm-shell would have worked previously. If this is something that should be supported by vterm, my suggestion would be to add support for arguments by allowing the user to configure vterm-shell to a list or to introduce an additional defcustom.
Edit: I added /bin/bash as a default as it should be available pretty much everywhere. But /bin/sh might be a better choice.
What if instead of a customized fallback shell you could use the same shell as used by TRAMP. If tramp works on the remote, then you could be sure that the shell is also working. Geting the TRAMP shell is just a one-liner:
(with-connection-local-variables shell-file-name)
see: https://github.com/akermu/emacs-libvterm/pull/652/commits/fcc4ec50c5493181397980216b5c3c697a60b8bf