Skip to content

Fix/directory handling combined#6711

Closed
shuv1337 wants to merge 3 commits into
anomalyco:devfrom
shuv1337:fix/directory-handling-combined
Closed

Fix/directory handling combined#6711
shuv1337 wants to merge 3 commits into
anomalyco:devfrom
shuv1337:fix/directory-handling-combined

Conversation

@shuv1337

@shuv1337 shuv1337 commented Jan 2, 2026

Copy link
Copy Markdown
Contributor

Fixes TUI attach command not properly passing the working directory context to the SDK client.

Changes:

  • Pass --dir argument from attach command through TUI to SDK via x-opencode-directory header
  • Use sync.data.path.directory for file autocomplete, theme discovery, exports, and path normalization
  • Add normalizePathFromDirectory utility function with tests

before:

tui-attach-before.mp4

after:

tui-attach-after.mp4

@shuv1337
shuv1337 force-pushed the fix/directory-handling-combined branch from 3270ae2 to 77b3b20 Compare January 2, 2026 23:57
When attaching to a remote server, the TUI wasn't properly passing the
working directory context. This fix ensures consistent directory
handling by:
- Passing --dir argument from attach command through TUI to SDK client
- Using sync.data.path.directory for file autocomplete URLs
- Using sync.data.path.directory for custom theme discovery
- Using sync.data.path.directory for exports and path normalization
- Adding normalizePathFromDirectory utility function
Tests for the normalizePathFromDirectory helper function covering:
- Converting absolute paths to relative paths
- Preserving already-relative paths unchanged
- Handling input equal to base directory (returns '.')
- Handling empty input (returns '')
@shuv1337
shuv1337 force-pushed the fix/directory-handling-combined branch from 77b3b20 to f99c175 Compare January 3, 2026 00:21
@shuv1337 shuv1337 closed this Jan 3, 2026
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