@@ -234,16 +234,16 @@ Status Debugger::SetPropertyValue(const ExecutionContext *exe_ctx,
234234 CommandInterpreter::eBroadcastBitResetPrompt, bytes.release ());
235235 GetCommandInterpreter ().BroadcastEvent (prompt_change_event_sp);
236236 } else if (property_path == g_debugger_properties[ePropertyUseColor].name ) {
237- // use-color changed. Ping the prompt so it can reset the ansi terminal
238- // codes.
239- SetPrompt ( GetPrompt ());
237+ // use-color changed. set use-color, this also pings the prompt so it can
238+ // reset the ansi terminal codes.
239+ SetUseColor ( GetUseColor ());
240240 } else if (property_path ==
241241 g_debugger_properties[ePropertyPromptAnsiPrefix].name ||
242242 property_path ==
243243 g_debugger_properties[ePropertyPromptAnsiSuffix].name ) {
244- // Prompt colors changed. Ping the prompt so it can reset the ansi
245- // terminal codes.
246- SetPrompt ( GetPrompt ());
244+ // Prompt color changed. set use-color, this also pings the prompt so it
245+ // can reset the ansi terminal codes.
246+ SetUseColor ( GetUseColor ());
247247 } else if (property_path ==
248248 g_debugger_properties[ePropertyShowStatusline].name ) {
249249 // Statusline setting changed. If we have a statusline instance, update it
@@ -253,7 +253,9 @@ Status Debugger::SetPropertyValue(const ExecutionContext *exe_ctx,
253253 else
254254 m_statusline.reset ();
255255 } else if (property_path ==
256- g_debugger_properties[ePropertyStatuslineFormat].name ) {
256+ g_debugger_properties[ePropertyStatuslineFormat].name ||
257+ property_path ==
258+ g_debugger_properties[ePropertySeparator].name ) {
257259 // Statusline format changed. Redraw the statusline.
258260 RedrawStatusline ();
259261 } else if (property_path ==
@@ -443,6 +445,8 @@ bool Debugger::GetUseColor() const {
443445bool Debugger::SetUseColor (bool b) {
444446 const uint32_t idx = ePropertyUseColor;
445447 bool ret = SetPropertyAtIndex (idx, b);
448+
449+ GetCommandInterpreter ().UpdateUseColor (b);
446450 SetPrompt (GetPrompt ());
447451 return ret;
448452}
@@ -481,6 +485,19 @@ const FormatEntity::Entry *Debugger::GetStatuslineFormat() const {
481485 return GetPropertyAtIndexAs<const FormatEntity::Entry *>(idx);
482486}
483487
488+ llvm::StringRef Debugger::GetSeparator () const {
489+ constexpr uint32_t idx = ePropertySeparator;
490+ return GetPropertyAtIndexAs<llvm::StringRef>(
491+ idx, g_debugger_properties[idx].default_cstr_value );
492+ }
493+
494+ bool Debugger::SetSeparator (llvm::StringRef s) {
495+ constexpr uint32_t idx = ePropertySeparator;
496+ bool ret = SetPropertyAtIndex (idx, s);
497+ RedrawStatusline ();
498+ return ret;
499+ }
500+
484501bool Debugger::GetUseAutosuggestion () const {
485502 const uint32_t idx = ePropertyShowAutosuggestion;
486503 return GetPropertyAtIndexAs<bool >(
@@ -974,11 +991,16 @@ Debugger::Debugger(lldb::LogOutputCallback log_callback, void *baton)
974991
975992 // Turn off use-color if this is a dumb terminal.
976993 const char *term = getenv (" TERM" );
977- if (term && ! strcmp (term, " dumb " ))
994+ auto disable_color = [&]() {
978995 SetUseColor (false );
996+ SetSeparator (" | " );
997+ };
998+
999+ if (term && !strcmp (term, " dumb" ))
1000+ disable_color ();
9791001 // Turn off use-color if we don't write to a terminal with color support.
9801002 if (!GetOutputFileSP ()->GetIsTerminalWithColors ())
981- SetUseColor ( false );
1003+ disable_color ( );
9821004
9831005 if (Diagnostics::Enabled ()) {
9841006 m_diagnostics_callback_id = Diagnostics::Instance ().AddCallback (
0 commit comments