Skip to content

Wait for linefeed with ShellStream.Expect #140

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

Closed
rhegner opened this issue Dec 22, 2016 · 2 comments
Closed

Wait for linefeed with ShellStream.Expect #140

rhegner opened this issue Dec 22, 2016 · 2 comments
Milestone

Comments

@rhegner
Copy link

rhegner commented Dec 22, 2016

I noticed that ShellStream.ReadLine() is not implemented using ShellStream.Expect(). I was wondering how I would wait for a linefeed using ShellStream.Expect()?

The reason for this is that I want to read from the shell line-by-line. And the end of a line can be a linefeed or a command promt.

So for reading a single line I tried this:

ShellStream.Expect(new Regex("\n|>"));

But it returns everything up to the next command promt and not just the first line. What am I doing wrong?

@IgorMilavec
Copy link
Collaborator

@rhegner Expect has a known bug, that we will try to fix as soon as possible. However, this fix might break some applications, that is why I'm trying to better understand usage patterns related to Expect API. Can you please explain how you use it and if possible provide a proto code for it?

@jscarle
Copy link
Contributor

jscarle commented Feb 13, 2024

@IgorMilavec @WojciechNagorski This was fixed by #1207 and #1319.

@WojciechNagorski WojciechNagorski added this to the vNext milestone Feb 13, 2024
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

4 participants