qt: fix crash on OSC 9;4 progress reports (configString on a bool key)
GHOSTTY_ACTION_PROGRESS_REPORT read `progress-style` with configString, but progress-style is a `bool` in Config.zig, not a string/enum. ghostty_config_get writes a 1-byte `true` into the zero-initialized `const char*`, leaving the pointer as 0x1; the non-null check passes and QString::fromUtf8 dereferences 0x1 and segfaults. This fired whenever a TUI emitted ConEmu OSC 9;4 progress sequences (e.g. Claude Code on startup), crashing the terminal. Read it with configBool — the type-correct 1-byte accessor — so `progress-style = false` still suppresses the taskbar entry. Co-Authored-By: claude-flow <ruv@ruv.net>pull/12846/head
parent
ae98153ed2
commit
f254f1b355
|
|
@ -2596,13 +2596,13 @@ bool MainWindow::onAction(ghostty_app_t, ghostty_target_s target,
|
|||
}
|
||||
|
||||
case GHOSTTY_ACTION_PROGRESS_REPORT: {
|
||||
// Honor `progress-style`: `none` suppresses the taskbar entry.
|
||||
// The default is to drive Unity LauncherEntry; future styles
|
||||
// (e.g. an in-window inline bar) would branch off here.
|
||||
const QString style =
|
||||
win ? win->configString("progress-style") : QStringLiteral("");
|
||||
if (style == QLatin1String("no") || style == QLatin1String("none"))
|
||||
return true;
|
||||
// Honor `progress-style`: when false, OSC 9;4 progress sequences
|
||||
// are silently ignored (no taskbar entry). It is a *bool* in
|
||||
// Config.zig — it MUST be read with configBool. configString
|
||||
// would hand ghostty_config_get a `const char**`; the 1-byte
|
||||
// bool write leaves a `0x1` pointer that QString::fromUtf8 then
|
||||
// dereferences and crashes on (e.g. when Claude emits progress).
|
||||
if (win && !win->configBool("progress-style", true)) return true;
|
||||
const ghostty_action_progress_report_s p = action.action.progress_report;
|
||||
const ghostty_action_progress_report_state_e state = p.state;
|
||||
const double fraction = p.progress >= 0 ? p.progress / 100.0 : 0.0;
|
||||
|
|
|
|||
Loading…
Reference in New Issue