-
Notifications
You must be signed in to change notification settings - Fork 477
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set prompt correctly for zsh #712
Conversation
Adds support to fakessh to emulate a specific shell with respect to prompt setting. The shell is specified as a parameter after the hostname, similar to real ssh taking a command to execute on the remote. This is slightly awkward when calling pxssh.login() as it means giving the server parameter as 'hostname shell', but this is only needed for the unit tests.
When the remote system/user is using zsh as their login shell, `\$` is not an escape sequence for the prompt, and so self.PROMPT fails to match because the backslash is included in the received text. The equivalent escape sequence for zsh is `%(!.#.$)`, so add a self.PROMPT_SET_ZSH using this sequence. Fixes pexpect#711
Many zsh users also use the prompt theme system from oh-my-zsh. This overrides the `PS1` setting, so setting the prompt fails for these users. Add the `prompt restore` command to disable oh-my-zsh's prompt and use the set `PS1` value.
cf4d6b8
to
686fa6f
Compare
I'm not sure why but the tests are not running, can you please confirm that you've locally run the tests and I can confirm later to complete the merge. |
The new tests and all existing tests in
In a full test suite there's just one unrelated failure in
|
Restore the sh-then-csh order of attempting to set a unique prompt, add zsh to the end of the list instead of in the middle. (Fixes pexpect#712 (comment))
I'll take a full run down of this change on the weekend as I want to get the automated test suite working again for GitHub issues. |
I had to close and re-open to get the tests to run. Sorry! |
Please fix the issues presented in the tests. |
For some reason the merge commit eae7087 merging
This prevents the test from executing the mock |
Merge commit eae7087 somehow removed the execute bit from the mode of tests/fakessh/ssh, breaking all tests using that mock ssh client.
All |
Fixes #711