Skip to content

feat: add sandbox selection and visual selection sending to Codex sessions#28

Open
lukeraphael wants to merge 1 commit intojohnseth97:mainfrom
lukeraphael:luke/add-sandbox-options
Open

feat: add sandbox selection and visual selection sending to Codex sessions#28
lukeraphael wants to merge 1 commit intojohnseth97:mainfrom
lukeraphael:luke/add-sandbox-options

Conversation

@lukeraphael
Copy link

This PR adds two launcher improvements to codex.nvim:

  • Support for configuring Codex sandbox mode in plugin setup via sandbox = 'read-only' | 'workspace-write' | 'danger-full-access'
  • Support for overriding sandbox mode per launch with :Codex and :CodexToggle

It also adds a new visual-selection workflow:

  • :CodexSendSelection and optional keymaps.send_selection now send highlighted text to Codex
  • If a Codex chat is already active, the selected text is sent into that existing session and the window is focused
  • If no chat is active, the selection starts a new Codex session as the initial prompt

Implementation notes

  • Added sandbox validation and CLI argument assembly for --sandbox
  • Added prompt forwarding so selected text can be passed as the initial Codex input
  • Added selection extraction from the current visual range
  • Reuse of active Codex sessions is implemented with chansend() for terminal-backed sessions

Docs

  • Updated README with sandbox config/usage
  • Documented visual selection sending and example visual-mode mapping

Testing

Added specs for:

  • default sandbox config
  • per-launch sandbox override
  • prompt forwarding to Codex
  • sending visual selection as a new prompt
  • reusing an active Codex session for selection sending

@lukeraphael lukeraphael closed this Mar 2, 2026
@lukeraphael lukeraphael reopened this Mar 2, 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