Skip to content

Commit 3eb6def

Browse files
authored
Fix history-support with multi-line (#1052)
1 parent b64f157 commit 3eb6def

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ impl InputSource {
3939
let prompt = prompt.unwrap_or_default();
4040
let curr_line = rl.readline(prompt);
4141
match curr_line {
42-
Ok(line) => Ok(Some(line)),
42+
Ok(line) => {
43+
let _ = rl.add_history_entry(line.as_str());
44+
Ok(Some(line))
45+
},
4346
Err(ReadlineError::Interrupted | ReadlineError::Eof) => Ok(None),
4447
Err(err) => Err(err),
4548
}

0 commit comments

Comments
 (0)