From 546a486bab56af06fd95b23fb2ce231d00f671c9 Mon Sep 17 00:00:00 2001 From: Flafy Date: Mon, 27 May 2024 23:31:35 +0300 Subject: [PATCH] hyprctl: add delimiter to hyprctl batch command (#6261) adds a delimiter of 3 newlines to separate different command outputs --- src/debug/HyprCtl.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/debug/HyprCtl.cpp b/src/debug/HyprCtl.cpp index 1faea41c..795272cc 100644 --- a/src/debug/HyprCtl.cpp +++ b/src/debug/HyprCtl.cpp @@ -1045,13 +1045,15 @@ std::string dispatchBatch(eHyprCtlOutputFormat format, std::string request) { nextItem(); + const std::string DELIMITER = "\n\n\n"; + while (curitem != "" || request != "") { - reply += g_pHyprCtl->getReply(curitem); + reply += g_pHyprCtl->getReply(curitem) + DELIMITER; nextItem(); } - return reply; + return reply.substr(0, std::max(static_cast(reply.size() - DELIMITER.size()), 0)); } std::string dispatchSetCursor(eHyprCtlOutputFormat format, std::string request) {