Skip to content

Add optional output redirection control to process spawn functions#1689

Merged
nmaguiar merged 6 commits intot8from
copilot/add-option-for-output-redirection
Feb 13, 2026
Merged

Add optional output redirection control to process spawn functions#1689
nmaguiar merged 6 commits intot8from
copilot/add-option-for-output-redirection

Conversation

Copy link
Contributor

Copilot AI commented Feb 12, 2026

endOpenAFAndStart and stopOpenAFAndRun currently hardcode output behavior - the former redirects to /dev/null on Unix, the latter inherits parent I/O. This adds a redirectOutput parameter to control this behavior.

Changes

  • endOpenAFAndStart(aCommandLineArray, noStop, redirectOutput)

    • New redirectOutput param (default: true for backward compatibility)
    • false keeps output visible instead of redirecting to /dev/null
  • stopOpenAFAndRun(aCommandLineArray, addCommand, redirectOutput)

    • New redirectOutput param (default: false for backward compatibility)
    • true redirects to /dev/null (Unix) or NUL (Windows)
  • endOpenAFAndStartOpenAF(aCommandLineArray, preCommandLineArray, noStop, redirectOutput)

    • Passes through redirectOutput to endOpenAFAndStart
  • AF.prototype methods

    • Updated to accept new parameter

Example

// Keep output visible when spawning detached process
endOpenAFAndStart(["/usr/bin/myapp"], true, false);

// Suppress output when replacing current process
stopOpenAFAndRun(["/usr/bin/myapp"], false, true);

Additional Fix

Corrected pre-existing bug in stopOpenAFAndRun where Unix/Windows command logic was inverted (unix=true was using cmd /c, should be /bin/sh -c).


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 4 commits February 12, 2026 19:29
…FAndRun, and endOpenAFAndStartOpenAF functions

Co-authored-by: nmaguiar <11761746+nmaguiar@users.noreply.github.com>
Co-authored-by: nmaguiar <11761746+nmaguiar@users.noreply.github.com>
…stopOpenAFAndRun

Co-authored-by: nmaguiar <11761746+nmaguiar@users.noreply.github.com>
Co-authored-by: nmaguiar <11761746+nmaguiar@users.noreply.github.com>
Copilot AI changed the title [WIP] Add option to redirect output to /dev/null Add optional output redirection control to process spawn functions Feb 12, 2026
Copilot AI requested a review from nmaguiar February 12, 2026 19:34
@nmaguiar nmaguiar marked this pull request as ready for review February 13, 2026 04:25
@nmaguiar nmaguiar merged commit 2f07ee7 into t8 Feb 13, 2026
1 check passed
@nmaguiar nmaguiar deleted the copilot/add-option-for-output-redirection branch February 13, 2026 04:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants