Skip to content

Commit 9a391b1

Browse files
authored
fix: clean up formatting before prompting for input (#1425)
1 parent defff47 commit 9a391b1

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

crates/q_chat/src/lib.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -825,6 +825,7 @@ impl ChatContext {
825825
if self.interactive {
826826
execute!(
827827
self.output,
828+
style::SetAttribute(Attribute::Reset),
828829
style::SetForegroundColor(Color::Magenta),
829830
style::Print("> "),
830831
style::SetAttribute(Attribute::Reset),
@@ -1282,7 +1283,11 @@ impl ChatContext {
12821283
self.input_source
12831284
.put_skim_command_selector(Arc::new(context_manager.clone()), tool_names);
12841285
}
1285-
1286+
execute!(
1287+
self.output,
1288+
style::SetForegroundColor(Color::Reset),
1289+
style::SetAttribute(Attribute::Reset)
1290+
)?;
12861291
let user_input = match self.read_user_input(&self.generate_tool_trust_prompt(), false) {
12871292
Some(input) => input,
12881293
None => return Ok(ChatState::Exit),
@@ -1480,6 +1485,7 @@ impl ChatContext {
14801485
// Display the content as if the user typed it
14811486
execute!(
14821487
self.output,
1488+
style::SetAttribute(Attribute::Reset),
14831489
style::SetForegroundColor(Color::Magenta),
14841490
style::Print("> "),
14851491
style::SetAttribute(Attribute::Reset),

0 commit comments

Comments
 (0)