pyinfra icon indicating copy to clipboard operation
pyinfra copied to clipboard

Improve documentation for server.shell() operation

Open asmaier opened this issue 11 months ago • 1 comments

Is your feature request related to a problem? Please describe

The documentation at

https://docs.pyinfra.com/en/3.x/operations/server.html#operations-server-shell

is lacking important information.

Describe the solution you'd like

It would already help if the page above would link to https://docs.pyinfra.com/en/3.x/arguments.html#shell-control-features . Then at least it would be clear that the default shell is sh with all its shortcomings. Another issue I had was that even setting a _shell_executable="zsh" will not give you your "normal" shell environment. It will lack all the usual environment variables. If I need them for my scripts, I have to ask for a login shell by setting _shell_executable="zsh -l" or _shell_executable="bash -l". The documentation should mention that.

And last but not least the documentation should clarify what the difference of server.shell() is to https://docs.pyinfra.com/en/3.x/operations/ssh.html#ssh-command . When would I use one over the other? I believe for beginners that is quite unclear.

asmaier avatar Jan 19 '25 22:01 asmaier

thanks and how to set bash globally for all local/server shell commands ?

ascorbic-acid avatar Apr 09 '25 04:04 ascorbic-acid