Skip to content

[Feature] Custom command to cycle between child sessions #5578

@fglogan

Description

@fglogan

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:

  1. See what child sessions exist
  2. Switch between them to monitor progress
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions