Fix system sleep prevention and add comprehensive test suite
- Fixed terminal control preventing system sleep by improving rustyline configuration and adding proper cleanup - Added signal handling for graceful termination and terminal state reset - Implemented comprehensive test suite with 58 unit and integration tests - Added testing dependencies: tempfile, mockall, tokio-test, serial_test - Created proper Drop implementation for InputHandler to ensure terminal cleanup - Enhanced exit handling in both normal exit and /exit command 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -78,7 +78,7 @@ impl ChatCLI {
|
||||
}
|
||||
|
||||
self.session.save()?;
|
||||
self.input.save_history()?;
|
||||
self.input.cleanup()?; // Use cleanup instead of just save_history
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -187,6 +187,7 @@ impl ChatCLI {
|
||||
}
|
||||
"/exit" => {
|
||||
self.session.save()?;
|
||||
self.input.cleanup()?; // Clean up terminal state
|
||||
self.display.print_info("Session saved. Goodbye!");
|
||||
return Ok(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user