Multiline pastes into the web terminal (especially into pi) were split
into one prompt per line because bracketed-paste markers were not
reaching the foreground app intact.
- Put the host PTY into raw mode (tty.setraw) after openpty() so it acts
as a pass-through pipe. The default canonical line discipline was
line-buffering input, splitting multiline pastes at newlines, and
mangling bracketed-paste markers before docker exec / pi could see
them. The in-container PTY (docker exec -t) provides real discipline.
- Route the mobile Paste button through xterm.js (term.paste) instead of
sending raw clipboard text to the WebSocket, so content is wrapped in
bracketed-paste markers when the app has enabled BPM.
- Treat a text frame as a control message only when it is a JSON object
with a known type (resize/ack/reset); otherwise forward as raw input
so JSON-shaped pastes are no longer silently dropped.
Quality gates: ruff, mypy (changed files), pytest unit (227 passed),
tsc, eslint
- Remove compose-level user: 0:0 override from manifest_compiler.py so the
entrypoint can start as root, fix mount ownership, and drop privileges to
the container user internally.
- Add get_manifest_container_user() helper to resolve the manifest-declared
container user (with uid:gid fallback).
- Pass container user through TerminalSession, TerminalManager, and the
terminal WebSocket handler so docker exec is invoked with --user <user>.
- Update and add unit tests for the manifest compiler and terminal session.
- Record the additional root-user fix in the fix-pi-container-mount-permissions
OpenSpec change/tasks.
Quality gates: pytest tests/unit/ (226 passed), pytest tests/services/test_terminal_manager_multi.py (7 passed), ruff check on changed files (clean), mypy on changed files (clean)