machinectl: add OSC context support to login/shell commands

This commit is contained in:
Lennart Poettering
2024-11-18 12:46:08 +01:00
parent 5eb39a385a
commit ff03ac8730

View 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");