mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 10:27:34 +00:00
LibVT: Support the DA (Device Attributes) request (final 'c')
This is used by vttest on startup to query the device for identity.
This commit is contained in:
parent
f4e7aecec2
commit
e6f5ce8285
4 changed files with 27 additions and 0 deletions
|
@ -491,6 +491,12 @@ void Terminal::escape$L(const ParamVector& params)
|
||||||
m_need_full_flush = true;
|
m_need_full_flush = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Terminal::escape$c(const ParamVector&)
|
||||||
|
{
|
||||||
|
// DA - Device Attributes
|
||||||
|
emit_string("\033[?1;0c");
|
||||||
|
}
|
||||||
|
|
||||||
void Terminal::escape$M(const ParamVector& params)
|
void Terminal::escape$M(const ParamVector& params)
|
||||||
{
|
{
|
||||||
int count = 1;
|
int count = 1;
|
||||||
|
@ -659,6 +665,9 @@ void Terminal::execute_escape_sequence(u8 final)
|
||||||
case 'h':
|
case 'h':
|
||||||
escape$h_l(false, question_param, params);
|
escape$h_l(false, question_param, params);
|
||||||
break;
|
break;
|
||||||
|
case 'c':
|
||||||
|
escape$c(params);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
dbgprintf("Terminal::execute_escape_sequence: Unhandled final '%c'\n", final);
|
dbgprintf("Terminal::execute_escape_sequence: Unhandled final '%c'\n", final);
|
||||||
break;
|
break;
|
||||||
|
@ -867,6 +876,12 @@ void Terminal::inject_string(const StringView& str)
|
||||||
on_char(str[i]);
|
on_char(str[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Terminal::emit_string(const StringView& str)
|
||||||
|
{
|
||||||
|
for (size_t i = 0; i < str.length(); ++i)
|
||||||
|
m_client.emit_char(str[i]);
|
||||||
|
}
|
||||||
|
|
||||||
void Terminal::unimplemented_escape()
|
void Terminal::unimplemented_escape()
|
||||||
{
|
{
|
||||||
StringBuilder builder;
|
StringBuilder builder;
|
||||||
|
|
|
@ -41,6 +41,7 @@ public:
|
||||||
virtual void set_window_title(const StringView&) = 0;
|
virtual void set_window_title(const StringView&) = 0;
|
||||||
virtual void terminal_did_resize(u16 columns, u16 rows) = 0;
|
virtual void terminal_did_resize(u16 columns, u16 rows) = 0;
|
||||||
virtual void terminal_history_changed() = 0;
|
virtual void terminal_history_changed() = 0;
|
||||||
|
virtual void emit_char(u8) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Attribute {
|
struct Attribute {
|
||||||
|
@ -145,6 +146,8 @@ private:
|
||||||
void unimplemented_escape();
|
void unimplemented_escape();
|
||||||
void unimplemented_xterm_escape();
|
void unimplemented_xterm_escape();
|
||||||
|
|
||||||
|
void emit_string(const StringView&);
|
||||||
|
|
||||||
void escape$A(const ParamVector&);
|
void escape$A(const ParamVector&);
|
||||||
void escape$B(const ParamVector&);
|
void escape$B(const ParamVector&);
|
||||||
void escape$C(const ParamVector&);
|
void escape$C(const ParamVector&);
|
||||||
|
@ -167,6 +170,7 @@ private:
|
||||||
void escape$T(const ParamVector&);
|
void escape$T(const ParamVector&);
|
||||||
void escape$L(const ParamVector&);
|
void escape$L(const ParamVector&);
|
||||||
void escape$h_l(bool, bool, const ParamVector&);
|
void escape$h_l(bool, bool, const ParamVector&);
|
||||||
|
void escape$c(const ParamVector&);
|
||||||
|
|
||||||
TerminalClient& m_client;
|
TerminalClient& m_client;
|
||||||
|
|
||||||
|
|
|
@ -679,6 +679,13 @@ void TerminalWidget::beep()
|
||||||
force_repaint();
|
force_repaint();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TerminalWidget::emit_char(u8 ch)
|
||||||
|
{
|
||||||
|
if (write(m_ptm_fd, &ch, 1) < 0) {
|
||||||
|
perror("emit_char: write");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void TerminalWidget::context_menu_event(GContextMenuEvent& event)
|
void TerminalWidget::context_menu_event(GContextMenuEvent& event)
|
||||||
{
|
{
|
||||||
if (!m_context_menu) {
|
if (!m_context_menu) {
|
||||||
|
|
|
@ -108,6 +108,7 @@ private:
|
||||||
virtual void set_window_title(const StringView&) override;
|
virtual void set_window_title(const StringView&) override;
|
||||||
virtual void terminal_did_resize(u16 columns, u16 rows) override;
|
virtual void terminal_did_resize(u16 columns, u16 rows) override;
|
||||||
virtual void terminal_history_changed() override;
|
virtual void terminal_history_changed() override;
|
||||||
|
virtual void emit_char(u8) override;
|
||||||
|
|
||||||
void set_logical_focus(bool);
|
void set_logical_focus(bool);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue