This example starts a real interactive shell inside the sandbox using
ExecInteractive, attached directly to your local terminal.
It configures:
- raw terminal mode (so keystrokes are passed through correctly)
- initial terminal rows/cols
SIGWINCHforwarding so resize events reach the guest PTY
From the repository root:
go run ./examples/go/exec_modesThe example uses ./bin/matchlock by default.
To override the binary path, set:
export MATCHLOCK_BIN=/path/to/matchlock- A shell prompt from inside the sandbox (
sh) - Interactive behavior similar to
matchlock run -it sh - Exit by typing
exitor pressingCtrl-D
ExecPipe is still available for bidirectional stdin/stdout/stderr without PTY.
Use ExecInteractive when you need terminal semantics (prompt handling, readline,
and resize behavior).