Convert \r to \n in bracketed pastes
It seems many terminals emits \r for newlines in bracketed pastes, manually convert this.
This commit is contained in:
parent
cb3512f01e
commit
1322abef64
|
@ -971,7 +971,15 @@ Optional<Key> TerminalUI::get_next_key()
|
||||||
|
|
||||||
if (m_paste_buffer)
|
if (m_paste_buffer)
|
||||||
{
|
{
|
||||||
m_paste_buffer->push_back(*c);
|
auto paste_convert = [](char c) {
|
||||||
|
switch (c)
|
||||||
|
{
|
||||||
|
case '\r': return '\n';
|
||||||
|
default: return c;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
m_paste_buffer->push_back(paste_convert(*c));
|
||||||
return Key{Key::Invalid};
|
return Key{Key::Invalid};
|
||||||
}
|
}
|
||||||
return parse_key(*c);
|
return parse_key(*c);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user