[Feature] Custom command to cycle between child sessions
Summary
Add a custom slash command (e.g., /cs or /child) to cycle through child sessions, providing an alternative to the keybind approach which can conflict with terminal emulators.
Problem
The current keybinds for cycling child sessions (<leader>+right / <leader>+left) don't work reliably across all terminal emulators. Some terminals capture arrow key combinations before OpenCode receives them.
Proposed Solution
Add a slash command that provides child session navigation:
/cs # Show list of child sessions with picker
/cs next # Cycle to next child session
/cs prev # Cycle to previous child session
/cs 1 # Jump to child session 1
/cs list # List all child sessions
Alternatively, extend the existing /session command:
/session children # List child sessions
/session child next # Cycle next
/session child 2 # Jump to specific child
Use Case
When using the Task tool, multiple child sessions are spawned. Users need a reliable way to:
- See what child sessions exist
- Switch between them to monitor progress
- Review results from completed child tasks
Additional Context
This would complement the existing keybind approach and provide a fallback for users whose terminal setups conflict with the default keybinds.
This issue might be a duplicate of existing issues. Please check:
- #3291: [FEATURE]: Navigation to parent session from child/subagent sessions - discusses session navigation challenges
- #2555: Cannot navigate to child sessions - reports keybind issues (ctrl+left/right don't work in iTerm/Terminal)
- #2816: navigate child sessions shortcut conflicts with macOS spaces/desktops - discusses keybind conflicts with OS shortcuts
- #4432: [FEATURE]: "session_child_return_to_parent" in keybinds - requests configurable keybinds for session navigation
Feel free to ignore if none of these address your specific case.
For keybind-related issues, please also check our pinned keybinds documentation: #4997