From b24f066c4799ac66cc86c0962447c690519df8ef Mon Sep 17 00:00:00 2001 From: vaxerski Date: Wed, 11 Jan 2023 12:17:27 +0100 Subject: escape json strings in hyprctl binds --- src/debug/HyprCtl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/debug/HyprCtl.cpp b/src/debug/HyprCtl.cpp index f47c44f4..b42e787b 100644 --- a/src/debug/HyprCtl.cpp +++ b/src/debug/HyprCtl.cpp @@ -503,8 +503,8 @@ std::string bindsRequest(HyprCtl::eHyprCtlOutputFormat format) { "dispatcher": "%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.key.c_str(), kb.keycode, kb.handler.c_str(), kb.arg.c_str()); + kb.locked ? "true" : "false", kb.mouse ? "true" : "false", kb.release ? "true" : "false", kb.repeat ? "true" : "false", kb.modmask, + 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 += "]"; -- cgit v1.2.3