Skip to content
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

better support for embedded targets, ssh #68

Open
jcaplan opened this issue Sep 25, 2022 · 2 comments
Open

better support for embedded targets, ssh #68

jcaplan opened this issue Sep 25, 2022 · 2 comments

Comments

@jcaplan
Copy link

jcaplan commented Sep 25, 2022

spawn_bash assumes you're spawning a new terminal on the same machine running rexpect. I use pexpect to write integration tests for embedded targets and pxssh is really useful. Having the fairly robust ssh login stuff for starters, but also not assuming the login shell is necessarily bash while still providing reliable synchronization and resetting the prompt (i.e. set PS1 but don't try to load .profile or anything)

@matthiasbeyer
Copy link
Member

Hi! Thanks for opening this issue.

Do you have a concrete request here? I am not sure I see one in your message 😆

@jcaplan
Copy link
Author

jcaplan commented Sep 25, 2022

Yeah I think this and #69 are about providing a more "batteries includes" experience for using rexpect to drive integration testing. I split them in two because this one is more about how you connect/open a process, whereas #69 is about providing helpful functions once the process is already opened. so off the top of my head useful features I know I relied on heavily in pexpect that would be nice to match:

  • port over pxssh login function
  • fdpexpect or similar where you can pass an open file descriptor (useful for building serial connection layer)
  • separate out syncing the shell prompt from spawn_bash() into into its own function prompt_sync() that can be easily used with other shells, not just bash. in pexpect replwrap you can override the command to start the shell and it doesn't try to do anything fancy like load the profile or anything.

just looking at the code for spawn_bash() I think it can be simplified a lot by passing bash -l option instead of manually looking for rcfiles etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants