[Lldb-commits] [lldb] [lldb] Turn on OSC 9; 4 graphical progress in supported terminals (PR #185541)

David Spickett via lldb-commits lldb-commits at lists.llvm.org
Tue Mar 10 01:53:34 PDT 2026


================
@@ -2077,6 +2077,30 @@ void Debugger::CancelForwardEvents(const ListenerSP &listener_sp) {
   m_forward_listener_sp.reset();
 }
 
+/// Conservative heuristic to detect whether OSC 9;4 progress is supported by
+/// the current terminal.
+static bool TerminalSupportsOSCProgress() {
+  static std::once_flag g_once_flag;
+  static bool g_supports_osc_progress = false;
+
+  std::call_once(g_once_flag, []() {
+    std::array<const char *, 4> g_known_env_vars = {
+        "WT_SESSION",            // Windows Terminal
+        "ConEmuPID",             // ConEmu
+        "GHOSTTY_RESOURCES_DIR", // Ghostty
+        "OSC_PROGRESS",          // Override
----------------
DavidSpickett wrote:

Can you provide a citation for this being the "standard" opt in variable?

When I google for "osc 9;4 progress codes", I see a bunch of specific terminals that do or do not support it. So that covers 99.9% of users. I don't think it's our job to document the opt-in variable but I want to confirm where it comes from.

https://github.com/llvm/llvm-project/pull/185541


More information about the lldb-commits mailing list