Add support for > and >> prompts with new readline

This commit is contained in:
2023-05-18 22:09:54 -04:00
parent eb43c99f47
commit d3c4c0801d
9 changed files with 47 additions and 9 deletions

View File

@@ -117,6 +117,11 @@ void ReadlineDevice::set_print_callback(print_callback cb) {
print_cb_ = cb;
}
void ReadlineDevice::set_prompt(const CodepointString &prompt) {
desired_prompt_ = prompt;
echo_command();
}
void ReadlineDevice::erase_command() {
int ccsize = current_prompt_.size() + current_command_.size();
if (ccsize > 0) {
@@ -168,6 +173,7 @@ CodepointString ReadlineDevice::putcode(char32_t c) {
desired_command_.clear();
current_prompt_.clear();
current_command_.clear();
echo_command();
return result;
} else if ((c == '\b') || (c == 127)) {
int len = desired_command_.size();