block / goose

Goose is a developer agent that operates from your command line to help you do the boring stuff.
https://block.github.io/goose/
Apache License 2.0
225 stars 36 forks source link

fix: Exiting the goose shell throws exception #276

Closed meenalc closed 4 days ago

meenalc commented 1 week ago

Currently goose shell throws exception while exiting. This PR fixes it. In general? is recommended over unwrap() in production code for proper error handling so replacing it

jsibbison-square commented 1 week ago

Happy to switch to ? but this still throws an exception doesn't it.

How are you exiting? /? help says you should use '/exit' to exit although I'm opening to explicitly supporting Ctrl+C for exit if that is what you are doing.

Testing it out, using/exit does not throw exception but Ctrl+c does throw. So I think the correct fix is to detect Ctrl+c explicitly in input in prompt.rs.

When I test Ctrl+C in this PR I get a red operation cancelled message which is better than panic but can still be approved so I'll approve that but I think we can improve it even more. image

meenalc commented 4 days ago

No longer needed, ctrl + c no longer gives issue