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

Added stop feature #103

Merged
merged 4 commits into from
Feb 9, 2024
Merged

Added stop feature #103

merged 4 commits into from
Feb 9, 2024

Conversation

thelastmayday
Copy link
Contributor

@thelastmayday thelastmayday commented Jan 31, 2024

Added a stop feature as requested on issue #79. By pressing 'q' the response in "ai chat" stops.

rl.input.setRawMode(true);

rl.input.on('keypress', (key) => {
if (typeof key === 'string' && key.toLowerCase().includes('q')) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a great idea. can/should we support the esc key as well? or is that not possible. i'm guessing most users will intuitively hit esc when wanting to stop the stream, so if that works as well it could be a nice addition

@thelastmayday
Copy link
Contributor Author

@steve8708 Added the escape key to stop the stream. Any what's your thoughts on this?

@steve8708
Copy link
Contributor

Looks great, will get this release soon, thanks for the contribution!

@steve8708 steve8708 merged commit 35a71c5 into BuilderIO:main Feb 9, 2024
2 checks passed
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

Successfully merging this pull request may close these issues.

2 participants