I was trying to operate on remote host using eshell and was disappointed to discover that majority of operations would hang emacs for several seconds.
I found it surprising considering that normally eshell executes subprocesses asynchronously and upon further investigation found that eshell reopens TRAMP connections for any external command.
Below is sequence of commands which I pass eshell buffer:
~ $ cd /ssh:aws:
/ssh:aws:/home/ubuntu $ ps
PID TTY TIME CMD
12212 pts/3 00:00:00 ps
/ssh:aws:/home/ubuntu $
And messages which indicate that eshell opens connection several times:
Tramp: Opening connection for aws using ssh...
Tramp: Sending command `exec ssh -o ControlPath=/tmp/tramp.32766gT7.%r@%h:%p -o ControlMaster=auto -o ControlPersist=no -e none aws'
Tramp: Waiting for prompts from remote shell...done
Tramp: Found remote shell prompt on `aws'
Tramp: Opening connection for aws using ssh...done
Tramp: Opening connection for aws using ssh...
Tramp: Sending command `exec ssh -q -o ControlPath=/tmp/tramp.32766gT7.%r@%h:%p -o ControlMaster=auto -o ControlPersist=no -e none aws'
Tramp: Waiting for prompts from remote shell...done
Tramp: Found remote shell prompt on `aws'
Tramp: Opening connection for aws using ssh...done
Is it a limitation of eshell that it needs to spawn new shell every invocation of non-builtin command or could I make it use TRAMP shell which, judging by list-processes, appears to persist since I first navigated to a path handled by TRAMP?