From 3c339732691da4c7e15488c3d07e227a6ea1e048 Mon Sep 17 00:00:00 2001 From: Anton Ovchinnikov Date: Sun, 23 Nov 2025 23:58:53 +0100 Subject: [PATCH] chore(exec): Update TODO regarding signal forwarding --- internal/machine/docker/client_exec.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/machine/docker/client_exec.go b/internal/machine/docker/client_exec.go index c14f13e9..e4096df4 100644 --- a/internal/machine/docker/client_exec.go +++ b/internal/machine/docker/client_exec.go @@ -201,10 +201,10 @@ func handleClientOutputStream(ctx context.Context, stream pb.Docker_ExecContaine // ExecContainer executes a command in a running container with bidirectional streaming. // TODO: This can be merged with pkg/client as it's an unnecessary logic split. func (c *Client) ExecContainer(ctx context.Context, opts ExecConfig) (exitCode int, err error) { - // TODO: We need to handle Ctrl-C and other signals here to forward them to the container process. - // Right now, Ctrl-C will just terminate the client process, which is not ideal. - // We should catch the signal, send it to the container process, and only exit - // when the container process exits. + // Note: In non-interactive mode (without TTY), signals like SIGTERM/SIGINT will terminate the client + // process without being forwarded to the remote container process. We could catch and forward these + // signals (useful for long-running commands), but for example "kubectl exec" doesn't do this either (as of November 2025), + // so we keep it simple for now. slog.Debug("starting ExecContainer", "containerID", opts.ContainerID, "options", opts.Options)