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

fix: Don't do anything with an empty command #409

Open
wants to merge 4 commits into
base: v1.0
Choose a base branch
from

Conversation

jamadeo
Copy link
Contributor

@jamadeo jamadeo commented Dec 4, 2024

I tend to hit enter on a REPL to see that it's alive (maybe that's just me?). It seems correct to do nothing if there's no content typed here by the user.

@michaelneale
Copy link
Collaborator

cc @jsibbison-square

@@ -107,6 +107,9 @@ impl<'a> Session<'a> {
match input.input_type {
InputType::Message => {
if let Some(content) = &input.content {
if content.trim().is_empty() {
continue;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it would be better to keep session.rs clear of any content parsing. Putting this logic in rustyline.rs where other user interaction elements are and returning. 'AskAgain' for this scenario is better I think.

aside: We should probably just delete cliclack.rs at this stage.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Aha, yes, that seems better

Copy link
Collaborator

@jsibbison-square jsibbison-square left a comment

Choose a reason for hiding this comment

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

I think it would be better to keep session.rs clear of any content parsing. Putting this logic in rustyline.rs where other user interaction elements are and returning. 'AskAgain' for this scenario is better I think.

aside: We should probably just delete cliclack.rs at this stage.

@jamadeo
Copy link
Contributor Author

jamadeo commented Dec 5, 2024

Also snuck in a small change not to treat EOF/Cmd+D as an error.

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.

3 participants