escape json strings in hyprctl binds

This commit is contained in:
Vaxry 2023-01-11 12:17:27 +01:00
parent 4ec034ad49
commit b24f066c47

View file

@ -503,8 +503,8 @@ std::string bindsRequest(HyprCtl::eHyprCtlOutputFormat format) {
"dispatcher": "%s", "dispatcher": "%s",
"arg": "%s" "arg": "%s"
},)#", },)#",
kb.locked ? "true" : "false", kb.mouse ? "true" : "false", kb.release ? "true" : "false", kb.repeat ? "true" : "false", kb.modmask, kb.submap.c_str(), kb.locked ? "true" : "false", kb.mouse ? "true" : "false", kb.release ? "true" : "false", kb.repeat ? "true" : "false", kb.modmask,
kb.key.c_str(), kb.keycode, kb.handler.c_str(), kb.arg.c_str()); escapeJSONStrings(kb.submap).c_str(), escapeJSONStrings(kb.key).c_str(), kb.keycode, escapeJSONStrings(kb.handler).c_str(), escapeJSONStrings(kb.arg).c_str());
} }
ret.pop_back(); ret.pop_back();
ret += "]"; ret += "]";