Skip to content

Commit 0497da7

Browse files
authored
fix(chat): Improve command parsing to handle paths starting with slash (#945)
Fixes an issue where pasting error messages or file paths that start with a slash (/) would be incorrectly interpreted as commands. This change improves the command parser to better distinguish between actual commands and text that happens to start with a slash character. Closes #894
1 parent 242c09c commit 0497da7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

crates/q_cli/src/cli/chat/command.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,11 @@ impl Command {
313313
},
314314
}
315315
},
316-
_ => return Err(format!("Unknown command: {}", input)),
316+
_ => {
317+
return Ok(Self::Ask {
318+
prompt: input.to_string(),
319+
});
320+
},
317321
});
318322
}
319323

0 commit comments

Comments
 (0)