MCPcopy Create free account
hub / github.com/Kilo-Org/cloud / createWindow

Function createWindow

dev/local/tmux.ts:127–153  ·  view source on GitHub ↗
(
  sessionName: string,
  windowName: string,
  env?: Record<string, string>,
  startupCommand?: string
)

Source from the content-addressed store, hash-verified

125
126function attachSession(sessionName: string): void {
127 execFileSync('tmux', ['attach-session', '-t', sessionName], { stdio: 'inherit' });
128}
129
130function createWindow(
131 sessionName: string,
132 windowName: string,
133 env?: Record<string, string>,
134 startupCommand?: string
135): number {
136 const args = [
137 'new-window',
138 '-d',
139 ...Object.entries(worktreeEnvironment(getWorktreeRoot(), env)).flatMap(([key, value]) => [
140 '-e',
141 `${key}=${value}`,
142 ]),
143 '-t',
144 sessionName,
145 '-n',
146 windowName,
147 '-c',
148 getWorktreeRoot(),
149 '-P',
150 '-F',
151 '#{window_index}',
152 ];
153 if (startupCommand) {
154 args.push(buildInteractiveShellCommand(startupCommand, undefined, getWorktreeRoot()));
155 }
156

Callers 1

startServiceInTmuxFunction · 0.90

Calls 3

getWorktreeRootFunction · 0.85
pushMethod · 0.80

Tested by

no test coverage detected