-
Notifications
You must be signed in to change notification settings - Fork 51
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
base: v1.0
Are you sure you want to change the base?
Conversation
crates/goose-cli/src/session.rs
Outdated
@@ -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; | |||
} |
There was a problem hiding this 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.
There was a problem hiding this comment.
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
There was a problem hiding this 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.
Also snuck in a small change not to treat EOF/Cmd+D as an error. |
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.