mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 05:57:44 +00:00
LibVT: Remove Vector<Kernel::KString> title stack
When using the kernel console, there's no such concept of title at all. Also, this makes vim to crash the kernel due to dereferencing a null pointer, so let's remove this as this is clearly not needed when using the kernel virtual console.
This commit is contained in:
parent
e93d19bbb1
commit
b22149601a
2 changed files with 4 additions and 14 deletions
|
@ -351,19 +351,18 @@ void Terminal::XTERM_WM(Parameters params)
|
||||||
return;
|
return;
|
||||||
switch (params[0]) {
|
switch (params[0]) {
|
||||||
case 22: {
|
case 22: {
|
||||||
|
#ifndef KERNEL
|
||||||
if (params.size() > 1 && params[1] == 1) {
|
if (params.size() > 1 && params[1] == 1) {
|
||||||
dbgln("FIXME: we don't support icon titles");
|
dbgln("FIXME: we don't support icon titles");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
dbgln_if(TERMINAL_DEBUG, "Title stack push: {}", m_current_window_title);
|
dbgln_if(TERMINAL_DEBUG, "Title stack push: {}", m_current_window_title);
|
||||||
#ifdef KERNEL
|
|
||||||
(void)m_title_stack.try_append(m_current_window_title.release_nonnull()); // FIXME: Propagate Error
|
|
||||||
#else
|
|
||||||
(void)m_title_stack.try_append(move(m_current_window_title));
|
(void)m_title_stack.try_append(move(m_current_window_title));
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 23: {
|
case 23: {
|
||||||
|
#ifndef KERNEL
|
||||||
if (params.size() > 1 && params[1] == 1)
|
if (params.size() > 1 && params[1] == 1)
|
||||||
return;
|
return;
|
||||||
if (m_title_stack.is_empty()) {
|
if (m_title_stack.is_empty()) {
|
||||||
|
@ -372,9 +371,6 @@ void Terminal::XTERM_WM(Parameters params)
|
||||||
}
|
}
|
||||||
m_current_window_title = m_title_stack.take_last();
|
m_current_window_title = m_title_stack.take_last();
|
||||||
dbgln_if(TERMINAL_DEBUG, "Title stack pop: {}", m_current_window_title);
|
dbgln_if(TERMINAL_DEBUG, "Title stack pop: {}", m_current_window_title);
|
||||||
#ifdef KERNEL
|
|
||||||
m_client.set_window_title(m_current_window_title->view());
|
|
||||||
#else
|
|
||||||
m_client.set_window_title(m_current_window_title);
|
m_client.set_window_title(m_current_window_title);
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
|
@ -1267,10 +1263,7 @@ void Terminal::execute_osc_sequence(OscParameters parameters, u8 last_byte)
|
||||||
} else {
|
} else {
|
||||||
// FIXME: the split breaks titles containing semicolons.
|
// FIXME: the split breaks titles containing semicolons.
|
||||||
// Should we expose the raw OSC string from the parser? Or join by semicolon?
|
// Should we expose the raw OSC string from the parser? Or join by semicolon?
|
||||||
#ifdef KERNEL
|
#ifndef KERNEL
|
||||||
m_current_window_title = Kernel::KString::try_create(stringview_ify(1)).release_value_but_fixme_should_propagate_errors();
|
|
||||||
m_client.set_window_title(m_current_window_title->view());
|
|
||||||
#else
|
|
||||||
m_current_window_title = stringview_ify(1).to_string();
|
m_current_window_title = stringview_ify(1).to_string();
|
||||||
m_client.set_window_title(m_current_window_title);
|
m_client.set_window_title(m_current_window_title);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -435,10 +435,7 @@ protected:
|
||||||
Attribute m_current_attribute;
|
Attribute m_current_attribute;
|
||||||
Attribute m_saved_attribute;
|
Attribute m_saved_attribute;
|
||||||
|
|
||||||
#ifdef KERNEL
|
#ifndef KERNEL
|
||||||
OwnPtr<Kernel::KString> m_current_window_title;
|
|
||||||
NonnullOwnPtrVector<Kernel::KString> m_title_stack;
|
|
||||||
#else
|
|
||||||
String m_current_window_title;
|
String m_current_window_title;
|
||||||
Vector<String> m_title_stack;
|
Vector<String> m_title_stack;
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue