Commit 8717ef9d authored by Christian Persch's avatar Christian Persch

emulation: Make OSC replies with same terminator as request

When replying to an OSC request with an OSC reply, use
the same string terminator (ST or BEL) as the request.

https://bugzilla.gnome.org/show_bug.cgi?id=722446
#65
parent a25b6339
......@@ -477,6 +477,8 @@ public:
SequenceBuilder& operator= (SequenceBuilder const&) = delete;
SequenceBuilder& operator= (SequenceBuilder&&) = delete;
inline constexpr unsigned int type() const noexcept { return m_seq.type; }
inline void set_type(unsigned int type) noexcept
{
m_seq.type = type;
......
......@@ -4115,10 +4115,22 @@ Terminal::send(vte::parser::u8SequenceBuilder const& builder,
void
Terminal::send(vte::parser::Sequence const& seq,
vte::parser::u8SequenceBuilder const& builder) noexcept
{
// FIXMEchpe take c1 & ST from @seq
send(builder, false);
vte::parser::u8SequenceBuilder const& builder) noexcept
{
// FIXMEchpe always take c1 & ST from @seq?
if (seq.type() == VTE_SEQ_OSC &&
builder.type() == VTE_SEQ_OSC) {
/* If we reply to a BEL-terminated OSC, reply with BEL-terminated OSC
* as well, see https://bugzilla.gnome.org/show_bug.cgi?id=722446 and
* https://gitlab.gnome.org/GNOME/vte/issues/65 .
*/
send(builder, false,
vte::parser::u8SequenceBuilder::Introducer::DEFAULT,
seq.terminator() == 0x7 ? vte::parser::u8SequenceBuilder::ST::BEL
: vte::parser::u8SequenceBuilder::ST::DEFAULT);
} else {
send(builder, false);
}
}
void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment