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

Time out a readline operation? #178

Open
HighCommander4 opened this issue Dec 12, 2018 · 6 comments
Open

Time out a readline operation? #178

HighCommander4 opened this issue Dec 12, 2018 · 6 comments

Comments

@HighCommander4
Copy link

HighCommander4 commented Dec 12, 2018

Is there a way to time out an Editor::readline() operation? That is, make it so that if the user doesn't enter anything within a time limit (say, 5 minutes), have readline() return with an error of some sort?

@gwenn
Copy link
Collaborator

gwenn commented Dec 12, 2018

No.

@HighCommander4
Copy link
Author

How difficult would it be to add this?

Or is there a way I could emulate it, by spinning up a second thread and running a timer on it, or something like that?

@gwenn
Copy link
Collaborator

gwenn commented Dec 12, 2018

You need to fix these calls:

@gwenn
Copy link
Collaborator

gwenn commented Dec 12, 2018

On unix, you can also use VTIME.
And it seems linefeed already supports what you want.

@HighCommander4
Copy link
Author

And it seems linefeed already supports what you want.

Thank you for the suggestion! This works well enough for me for now.

@Ralith
Copy link

Ralith commented Mar 13, 2019

See also #126, which subsumes this.

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

No branches or pull requests

3 participants