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

Show full screen output on Wait+Line mismatch #533

Open
3v1n0 opened this issue Oct 17, 2024 · 2 comments
Open

Show full screen output on Wait+Line mismatch #533

3v1n0 opened this issue Oct 17, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@3v1n0
Copy link

3v1n0 commented Oct 17, 2024

Is your feature request related to a problem? Please describe.

Thanks to @mastercactapus we've finally the Wait feature, but when waiting for a line on failure it's hard to understand the context as the error is just:

failed to execute command: timeout waiting for "Line Username:$" to match Username:$; last value was: >

Describe the solution you'd like

Other than showing the failed line (ideally in a new line so that's clearer), the whole context should be shown as when using Wait+Screen

Describe alternatives you've considered
Using Wait+Screen /Username:\n/ is an option but that doesn't make sure that we're matching the last screen line.

@3v1n0 3v1n0 added the enhancement New feature or request label Oct 17, 2024
@mastercactapus
Copy link
Contributor

I can see how that would help debugging -- we could print the entire buffer, though it would be important to indicate which line the cursor is on (since that's the one being checked).

For your issue, the last line is likely the cursor, but if that ever weren't the case, it would help understand what happened.

@bashbunni
Copy link
Member

That sounds good. It looks like there's definitely room for improvement with the error message here for sure. It would be nice to have the error message similar to the one we will be using in Freeze

image

Here's the code behind this output: https://github.com/charmbracelet/freeze/pull/119/files#diff-097efd4fdcfbc4644e1d6fd6b758f217ca51969e14309c8b70d42a6e41dde579

You might also find great success with using https://github.com/charmbracelet/log

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

No branches or pull requests

3 participants