]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
machinectl: add OSC context support to login/shell commands
authorLennart Poettering <lennart@poettering.net>
Mon, 18 Nov 2024 11:46:08 +0000 (12:46 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 27 Feb 2025 14:09:25 +0000 (15:09 +0100)
src/machine/machinectl.c

index 91bef1a5e99406e273eac92f3627ac515fd4ae19..b7b7130fdb31d16b79236c8bbade46277cfd31fc 100644 (file)
@@ -46,6 +46,7 @@
 #include "main-func.h"
 #include "mkdir.h"
 #include "nulstr-util.h"
+#include "osc-context.h"
 #include "pager.h"
 #include "parse-argument.h"
 #include "parse-util.h"
@@ -1222,6 +1223,13 @@ static int process_forward(sd_event *event, sd_bus_slot *machine_removed_slot, i
                         log_info("Connected to machine %s. Press ^] three times within 1s to exit session.", name);
         }
 
+        _cleanup_(osc_context_closep) sd_id128_t osc_context_id = SD_ID128_NULL;
+        if (!terminal_is_dumb()) {
+                r = osc_context_open_container(name, /* ret_seq= */ NULL, &osc_context_id);
+                if (r < 0)
+                        return r;
+        }
+
         r = sd_event_set_signal_exit(event, true);
         if (r < 0)
                 return log_error_errno(r, "Failed to enable SIGINT/SITERM handling: %m");