From: Lennart Poettering Date: Mon, 18 Nov 2024 11:46:08 +0000 (+0100) Subject: machinectl: add OSC context support to login/shell commands X-Git-Tag: v258-rc1~1227^2~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ff03ac873093db2bdb165c1216ab196322502b4f;p=thirdparty%2Fsystemd.git machinectl: add OSC context support to login/shell commands --- diff --git a/src/machine/machinectl.c b/src/machine/machinectl.c index 91bef1a5e99..b7b7130fdb3 100644 --- a/src/machine/machinectl.c +++ b/src/machine/machinectl.c @@ -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");