Skip to content

feat(tui): expose jailoc context to the TUI#78

Closed
speedo17 wants to merge 2 commits into
seznam:mainfrom
speedo17:feat/67-jailoc-context-tui
Closed

feat(tui): expose jailoc context to the TUI#78
speedo17 wants to merge 2 commits into
seznam:mainfrom
speedo17:feat/67-jailoc-context-tui

Conversation

@speedo17

Copy link
Copy Markdown
Contributor

Closes #67
Sets JAILOC=1 and JAILOC_WORKSPACE in 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.

                                                                                                                                                          ┃                       ┃    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
Copilot AI review requested due to automatic review settings April 16, 2026 20:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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=1 and JAILOC_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 pass OPENCODE_DISABLE_TERMINAL_TITLE=1 to prevent OpenCode from overwriting it.
  • Reserve JAILOC and JAILOC_WORKSPACE in 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.

Comment thread internal/config/config_test.go
Comment thread internal/config/config.go
Comment thread internal/config/config_test.go
@thejoeejoee thejoeejoee added feature New functionality ux CLI usability, output formatting, error messages go Pull requests that update go code labels Apr 17, 2026
@thejoeejoee

Copy link
Copy Markdown
Collaborator

except terminal title override done in #112

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New functionality go Pull requests that update go code ux CLI usability, output formatting, error messages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose jailoc context to the TUI

3 participants