MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / openSessionPicker

Method openSessionPicker

apps/kimi-code/src/tui/kimi-tui.ts:2684–2708  ·  view source on GitHub ↗
(options: {
    readonly applyStartupModes: boolean;
    readonly closeOnCancel: boolean;
    readonly forwardEditorExit: boolean;
  })

Source from the content-addressed store, hash-verified

2682 }
2683
2684 private async openSessionPicker(options: {
2685 readonly applyStartupModes: boolean;
2686 readonly closeOnCancel: boolean;
2687 readonly forwardEditorExit: boolean;
2688 }): Promise<void> {
2689 this.sessionPickerOptions = options;
2690 await this.fetchSessions('cwd');
2691 this.mountSessionPicker({
2692 applyStartupModes: options.applyStartupModes,
2693 onCancel: () => {
2694 this.hideSessionPicker();
2695 if (options.closeOnCancel) void this.stop();
2696 },
2697 onCtrlC: options.forwardEditorExit
2698 ? () => {
2699 this.state.editor.onCtrlC?.();
2700 }
2701 : undefined,
2702 onCtrlD: options.forwardEditorExit
2703 ? () => {
2704 this.state.editor.onCtrlD?.();
2705 }
2706 : undefined,
2707 });
2708 }
2709
2710 private async toggleSessionPickerScope(selectedSessionId: string): Promise<void> {
2711 const requestToken = ++this.sessionPickerScopeRequestToken;

Callers 2

showSessionPickerMethod · 0.95
bootstrapFromPickerMethod · 0.95

Calls 4

fetchSessionsMethod · 0.95
mountSessionPickerMethod · 0.95
hideSessionPickerMethod · 0.95
stopMethod · 0.95

Tested by

no test coverage detected