Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 11, 2025

Removes leftover debug code from prepare_process() that was inadvertently hiding console windows for all processes without IO redirection, not just detached processes.

The code set STARTF_USESHOWWINDOW and SW_HIDE on the startup info, affecting behavioral correctness for existing non-detached process execution.

Additionally, refactors duplicated detached mode handling logic into a shared helper function to improve code maintainability.

Changes:

  • Removed startup_info.dwFlags |= STARTF_USESHOWWINDOW
  • Removed startup_info.wShowWindow = SW_HIDE assignment
  • Removed explanatory comment about console window visibility control
  • Added send_detached_process_success() helper method to MessageProcessor
  • Replaced 4 duplicate code blocks in exec_process, exec_batch, exec_winps, and exec_pwsh methods

The imports remain as they're still correctly used in prepare_process_with_io_redirection().


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

@pacmancoder
Copy link
Contributor

pacmancoder commented Nov 11, 2025

@copilot also implement changes based on this thread in this PR: #1567 (comment)

Copilot AI changed the title [WIP] Address feedback on exec detached mode implementation fix(agent): remove debug code that hides console windows for all processes Nov 11, 2025
Copilot finished work on behalf of pacmancoder November 11, 2025 13:03
Copilot AI requested a review from pacmancoder November 11, 2025 13:03
Copy link
Contributor Author

Copilot AI commented Nov 11, 2025

@copilot also implement changes based on this thread in this PR: #1567 (comment)

Extracted the duplicated detached mode handling logic into a helper function named send_detached_process_success() as requested. The method is now used in all four places: exec_process, exec_batch, exec_winps, and exec_pwsh.

Fixed in commit 9010462

Copilot AI changed the title fix(agent): remove debug code that hides console windows for all processes fix(agent): remove debug code and refactor detached process handling Nov 11, 2025
Copilot finished work on behalf of pacmancoder November 11, 2025 13:16
@pacmancoder pacmancoder marked this pull request as ready for review November 11, 2025 13:16
@pacmancoder pacmancoder merged commit f62de11 into feat/exec-detached Nov 11, 2025
47 of 48 checks passed
@pacmancoder pacmancoder deleted the copilot/sub-pr-1567 branch November 11, 2025 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants