Skip to content

Start terminal in the selected project, use the login shell, and polish rendering#13

Open
LonestoneBot wants to merge 2 commits into
cloudcli-ai:mainfrom
LonestoneBot:openclaw/terminal-project-cwd-polish
Open

Start terminal in the selected project, use the login shell, and polish rendering#13
LonestoneBot wants to merge 2 commits into
cloudcli-ai:mainfrom
LonestoneBot:openclaw/terminal-project-cwd-polish

Conversation

@LonestoneBot

Copy link
Copy Markdown

Three terminal UX improvements, split into two commits (backend / frontend).

1. Start the shell in the selected project directory

New shells opened in the home directory regardless of the active CloudCLI
project. The client now sends an init message with api.context.project.path
on connect; the server validates it (statSync) and starts the shell there,
falling back to $HOME when absent/invalid. Spawning is deferred until init
arrives, with a short fallback timer so older clients still work. Existing tabs
keep their original directory; new tabs follow project switches via
onContextChange.

2. Use the user's login shell

When SHELL is absent from the server's environment (common when the plugin
server is launched from a GUI context) the shell fell back to a bare
/bin/bash — no prompt, no colors, no rc. It now falls back to the login shell
from /etc/passwd via os.userInfo().shell, restoring the user's prompt,
colors and configuration.

3. Rendering polish (no new deps, keeps WebGL)

Roomier lineHeight, small letterSpacing, bar cursor, bolder bold weight,
mild minimumContrastRatio, and a font stack that leads with Menlo / SF Mono on
macOS while keeping the cross-platform and CJK/emoji fallbacks.

Testing

  • WS harness (SHELL removed from env): init valid → shell starts in the
    project dir (verified via pwd); invalid → $HOME; no init → fallback
    timer + ready; shell resolves to the login shell.
  • tsc build passes. Only src/ changes (dist/ is gitignored).
  • Verified live in CloudCLI: new tabs open in the project dir with the zsh
    prompt and colored output.

🤖 Generated with Claude Code

LonestoneBot and others added 2 commits July 11, 2026 16:46
Two related backend fixes for the pty spawn:

- Working directory: accept an `init` message carrying the CloudCLI project
  path and start the shell there (validated with statSync). Spawning is
  deferred until the client sends `init`; a short fallback timer starts the
  shell in $HOME if no `init` arrives (older clients), so behavior is
  unchanged when the path is absent or invalid.

- Login shell: when SHELL is absent from the server's environment (common when
  the plugin server is launched from a GUI context), fall back to the user's
  login shell from /etc/passwd via os.userInfo().shell instead of a bare
  /bin/bash. This restores the user's prompt, colors and rc configuration.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Send an `init` message with the selected project path (api.context.project)
  when each session's socket opens, kept in sync via onContextChange. Existing
  tabs keep their original directory.

- Rendering polish (no new dependencies, keeps the WebGL renderer): roomier
  lineHeight, small letterSpacing, bar cursor, bolder bold weight, mild
  minimumContrastRatio, and a font stack that leads with Menlo / SF Mono on
  macOS while keeping the cross-platform and CJK/emoji fallbacks.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.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.

1 participant