Skip to content

Commit 643011e

Browse files
Execute startup scripts as single bash heredoc
Wraps startup scripts in a heredoc so they execute as a single script rather than line-by-line. This supports shebangs and ensures all commands run in the same subshell.
1 parent 71446b6 commit 643011e

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/components/terminal/task-terminal.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,10 +314,11 @@ export function TaskTerminal({ taskName, cwd, className, aiMode, description, st
314314
const { startupScript: currentStartupScript, aiMode: currentAiMode, description: currentDescription, taskName: currentTaskName, serverPort: currentServerPort } = pendingStartup
315315

316316
// 1. Run startup script first (e.g., mise trust, mkdir .vibora, export VIBORA_DIR)
317+
// Wrap in heredoc so it executes as a single script (supports shebangs)
317318
if (currentStartupScript) {
318319
setTimeout(() => {
319-
// Write the script as-is - newlines act as Enter presses in terminals
320-
writeToTerminalRef.current(actualTerminalId, currentStartupScript + '\r')
320+
const wrappedScript = `bash <<'VIBORA_STARTUP'\n${currentStartupScript}\nVIBORA_STARTUP`
321+
writeToTerminalRef.current(actualTerminalId, wrappedScript + '\r')
321322
}, 100)
322323
}
323324

0 commit comments

Comments
 (0)