Navigation Menu

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

Add PHP inspired output buffering #717

Closed
jcubic opened this issue Dec 12, 2021 · 1 comment
Closed

Add PHP inspired output buffering #717

jcubic opened this issue Dec 12, 2021 · 1 comment
Labels
feature resolved if issue is resolved, it will be open until merge with master

Comments

@jcubic
Copy link
Owner

jcubic commented Dec 12, 2021

I have an idea for a new feature for jQuery Terminal

Similar to PHP where you start buffer and then you can get the output of buffer to string.

This will allow to call exec and get the output as string.
The API can be similar to PHP.

term.ob_start();
term.exec('some command');
const output = term.ob_get_contents();
term.ob_end_clean();
// or
term.ob_end_flush();
@jcubic jcubic added the feature label Dec 12, 2021
jcubic added a commit that referenced this issue Dec 14, 2021
* fix case when echo two lines with echo newline and flush false
* refactor get_output_buffer function
* rename clear_buffer
@jcubic
Copy link
Owner Author

jcubic commented Dec 14, 2021

The API is"

clear_buffer();
// and
get_output_buffer();

@jcubic jcubic added the resolved if issue is resolved, it will be open until merge with master label Dec 14, 2021
@jcubic jcubic closed this as completed Dec 14, 2021
@jcubic jcubic mentioned this issue Apr 10, 2023
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature resolved if issue is resolved, it will be open until merge with master
Projects
None yet
Development

No branches or pull requests

1 participant