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

Is reedline full-duplex? How do I print_line while read_lineing? #320

Closed
vi opened this issue Feb 20, 2022 · 5 comments
Closed

Is reedline full-duplex? How do I print_line while read_lineing? #320

vi opened this issue Feb 20, 2022 · 5 comments
Labels
duplicate This issue or pull request already exists enhancement New feature or request

Comments

@vi
Copy link

vi commented Feb 20, 2022

Is a chat-like application an intended use case for Reedline? If no, it should be explicitly documented. If yes, a sample that prints messages from a timer while simultaneously allowing user to edit the command line should be provided.

I don't see this feature in neither of Rust readline crates, it is even absent from a comparison table. It is also absent from Brainstorming Features issue - is it only for user-facing features or also for system ones like support for async or custom file descriptors?

@vi vi added the enhancement New feature or request label Feb 20, 2022
@fdncred
Copy link
Collaborator

fdncred commented Feb 21, 2022

I'm not sure we've ever considered this use case. It's interesting.

@sholderbach
Copy link
Member

This idea is similar to #236. There is certainly some interest to be able to have some background process/thread/task printing without disrupting the layout of the prompt.
Currently we certainly focus first and foremost to achieve a stable version for use in nushell. But we should come back to that in the future.

@sholderbach sholderbach added the duplicate This issue or pull request already exists label Feb 26, 2022
@GrxE
Copy link
Contributor

GrxE commented Aug 24, 2022

Hi all!
Due to my need for an external printer,I made a very basic ExternalPrinter as an optional feature. You can take a look: https://github.com/GrxE/reedline.
Do you want me to make a PR?

@sholderbach
Copy link
Member

Awesome @GrxE, we would be happy to take a look!

sholderbach pushed a commit that referenced this issue Sep 14, 2022
Addresses #320, #236

* Adding External printer

* Made ExternalPrinter as an optional feature. Clippy is happy, test pass, docs added.

* ExternalPrinter: prints multiple messages if available, more on error-handling.

* Bug(s) fixed. Prints messages. Working example in examples folder. Code formatted, clippyed, tests pass.

* Generic ExternalPrinter<T> where T: Display.

* Fixed: Works with buffers larger than a line.

* Fixed: Works with buffers larger than a line, refactored.

* Different approach, seems to look like what is expected. Gives the "illusion" of one line being entered. Needs more testing, could have some off by one errors ;)

Co-authored-by: Gregor Engberding <[email protected]>
@sholderbach
Copy link
Member

MVP landed in #467.

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

No branches or pull requests

4 participants