()
| 55 | } |
| 56 | |
| 57 | async function handleFork() { |
| 58 | try { |
| 59 | const currentSession = getCurrentSession(); |
| 60 | const forkCommand = `cn --fork ${currentSession.sessionId}`; |
| 61 | // Try to copy to clipboard dynamically to avoid hard dependency in tests |
| 62 | try { |
| 63 | const clipboardy = await import("clipboardy"); |
| 64 | await clipboardy.default.write(forkCommand); |
| 65 | return { |
| 66 | exit: false, |
| 67 | output: chalk.gray(`${forkCommand} (copied to clipboard)`), |
| 68 | }; |
| 69 | } catch { |
| 70 | return { |
| 71 | exit: false, |
| 72 | output: chalk.gray(`${forkCommand}`), |
| 73 | }; |
| 74 | } |
| 75 | } catch (error: any) { |
| 76 | return { |
| 77 | exit: false, |
| 78 | output: chalk.red(`Failed to create fork command: ${error.message}`), |
| 79 | }; |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | function handleTitle(args: string[]) { |
| 84 | const title = args.join(" ").trim(); |
nothing calls this directly
no test coverage detected