Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/kimi_cli/ui/shell/session_picker.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,15 @@ def __init__(
async def run(self) -> tuple[str, KaosPath] | None:
"""Run the picker and return ``(session_id, work_dir)``, or *None*."""
await self._load_sessions()

# Skip the picker when no other sessions exist.
other_sessions = [s for s in self._sessions if s.id != self._current_session.id]
if not other_sessions:
Comment on lines +76 to +77
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Keep picker open when cross-directory sessions exist

This early return checks other_sessions from the initial _load_sessions() call, which is always in current scope, so /sessions now exits before rendering whenever the current directory has no alternatives. In that case users can no longer press Ctrl+A to switch to all scope and resume sessions that exist in other work directories, which regresses the directory-scope toggle behavior in SessionPickerApp.run().

Useful? React with 👍 / 👎.

from kimi_cli.ui.shell.console import console

console.print("[yellow]No other sessions to switch to.[/yellow]")
return None

self._sync_radio_list()
result = await self._app.run_async()
if result is None:
Expand Down
Loading