feat(tui): expose jailoc context to the TUI#78
Closed
speedo17 wants to merge 2 commits into
Closed
Conversation
┃ ┃ Context
- set JAILOC=1 and JAILOC_WORKSPACE in compose template 24,033 tokens
- reserve JAILOC/JAILOC_WORKSPACE as protected env keys in config 12% used
- set terminal title 'jailoc | <workspace>' from attach (host + exec) -zsh.00 spent
- suppress OpenCode's built-in title via OPENCODE_DISABLE_TERMINAL_TITLE=1
Contributor
There was a problem hiding this comment.
Pull request overview
This PR exposes “jailoc context” to OpenCode sessions by injecting jailoc-specific environment markers into the generated Compose project and by setting a custom terminal title during jailoc attach (both remote/host and exec modes), while disabling OpenCode’s own title updates.
Changes:
- Inject
JAILOC=1andJAILOC_WORKSPACE=<workspace>into the opencode service environment in the embedded Compose template. - Set the host terminal title to
jailoc | <workspace>during attach (clearing it on detach) and passOPENCODE_DISABLE_TERMINAL_TITLE=1to prevent OpenCode from overwriting it. - Reserve
JAILOCandJAILOC_WORKSPACEin config validation and document the new reserved keys.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/embed/assets/docker-compose.yml.tmpl | Adds JAILOC and JAILOC_WORKSPACE to the opencode container environment. |
| internal/docker/docker.go | Extends Client.Exec to accept per-exec environment overrides passed through to Compose exec. |
| internal/config/config.go | Marks JAILOC and JAILOC_WORKSPACE as reserved env keys. |
| internal/config/config_test.go | Updates reserved env key validation tests to include the new keys. |
| internal/compose/compose_test.go | Verifies the generated compose includes the new injected env vars. |
| internal/cmd/root.go | Passes workspace name into exec attach flow. |
| internal/cmd/attach.go | Implements terminal title setting/clearing and disables OpenCode title updates in both attach modes. |
| internal/cmd/attach_test.go | Adds unit tests for the terminal title escape sequence writer. |
| docs/reference/configuration.md | Documents JAILOC and JAILOC_WORKSPACE as reserved keys. |
| docs/explanation/container-architecture.md | Explains the injected env vars and terminal-title behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Collaborator
|
except terminal title override done in #112 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #67
Sets
JAILOC=1andJAILOC_WORKSPACEin the compose template for programmatic detection, and sets a custom terminal title (jailoc | <workspace>) from the attach command (both host and exec modes) while suppressing OpenCode's own title. Both env vars are reserved so users can't accidentally override them.