Skip to content

fix(pty): 修复 Docker 数据卷下的终端启动与 resize 回退 - #106

Merged
yxsj245 merged 2 commits into
GSManagerXZ:mainfrom
sakuradairong:cursor/fix-pty-builtin-package-0ca9
Aug 7, 2026
Merged

fix(pty): 修复 Docker 数据卷下的终端启动与 resize 回退#106
yxsj245 merged 2 commits into
GSManagerXZ:mainfrom
sakuradairong:cursor/fix-pty-builtin-package-0ca9

Conversation

@sakuradairong

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #104 for Docker and packaged deployments where persistent volumes can hide runtime binaries and root-owned paths can block the PTY resize control channel.

  • fall back through owner-controlled terminal-control directories, including ~/.gsm3 and a private $TMPDIR/gsm3-terminal-control-<uid>
  • seed missing PTY, Zip-Tools, and 7z assets from the image's immutable builtin directory into server/data/lib
  • validate and probe existing PTY assets across runtime, development, current Docker builtin, and legacy Docker paths before downloading
  • keep downloads and replacements restricted to writable runtime directories
  • remove the startup script's dependency on the unavailable file command so valid PTY assets are no longer deleted during container startup
  • add current and legacy builtin path fallbacks for Zip-Tools and 7z

Scope

Clean branch based on the latest upstream/main:

  • 2 commits
  • 4 modified files
  • no unrelated fork-only changes

Verification

  • cd server && npx tsc --noEmit
  • cd client && npx tsc --noEmit
  • npm --prefix server run build
  • npm --prefix client run build
  • cd server && npx jest --runInBand — 5 suites / 40 tests passing
  • bash -n start.sh
  • git diff --check upstream/main...HEAD
  • git merge-tree --write-tree upstream/main HEAD — clean

Docker integration verification with a fresh persistent data volume:

  • PTY, Zip-Tools, and 7z were available without runtime downloads
  • authenticated WebSocket PTY creation succeeded
  • real OS winsize changed from 33x98 to 49x146 (verified with stty size)
  • unsafe root-owned candidates were rejected and the control channel used /tmp/gsm3-terminal-control-0 with mode 0700

Review result

No blocking code-review findings or merge conflicts were found. Client build only reports the existing chunk-size/dynamic-import warnings unrelated to this change.

cursoragent and others added 2 commits August 6, 2026 17:08
…inux

When data/terminal-control is missing or owned by another user (e.g. root),
fall back to ~/.gsm3/terminal-control and $TMPDIR/gsm3-terminal-control-<uid>
so Steam install and terminal sessions can still start.

Co-authored-by: RainySY <sakuradairong@users.noreply.github.com>
… path

Docker and packaged deployments store PTY/Zip-Tools/7z under data/lib,
but start.sh runs from server/ so PtyManager only checked server/data/lib.
When gsm3_data volume mounts over server/data, built-in binaries are lost.

- start.sh: seed server/data/lib from data/lib and recover invalid PTY
- package.js: mirror lib assets to server/data/lib and improve linux start.sh
- ptyManager/zipToolsManager: add ../data/lib lookup for server cwd
- Dockerfile: backup downloaded lib assets to /root/data/lib outside volume

Co-authored-by: RainySY <sakuradairong@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants