Skip to content

Conversation

@prmukherj
Copy link
Collaborator

Context

A pop up window was appearing while launching fluent with "no_graphics" or "no_gui_or_graphics" mode.

Change Summary

In Process open, shell is no longer used.

Rationale

Cleanest and safest approach. Just passing the args as list of args.

Impact

No pop up window comes up while launching fluent with "no_graphics" or "no_gui_or_graphics" mode.

Copilot AI review requested due to automatic review settings November 28, 2025 11:02
@prmukherj prmukherj linked an issue Nov 28, 2025 that may be closed by this pull request
2 tasks
@github-actions github-actions bot added the bug Issue, problem or error in PyFluent label Nov 28, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes an issue where a pop-up window appeared when launching Fluent in "no_graphics" or "no_gui_or_graphics" mode on Windows. The fix removes the use of shell execution and adds the CREATE_NO_WINDOW flag to prevent the console window from appearing.

  • Removed shell=True from subprocess calls to avoid shell-related popup issues
  • Added CREATE_NO_WINDOW flag for Windows subprocess creation
  • Added logic to strip the "start " prefix from launch commands when present

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/ansys/fluent/core/launcher/standalone_launcher.py Adds preprocessing to remove "start " prefix from launch commands before subprocess execution
src/ansys/fluent/core/launcher/launcher_utils.py Removes shell=True and adds CREATE_NO_WINDOW flag to prevent popup windows on Windows

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

kwargs.update(shell=True, creationflags=subprocess.CREATE_NEW_PROCESS_GROUP)
kwargs.update(
creationflags=subprocess.CREATE_NEW_PROCESS_GROUP
| subprocess.CREATE_NO_WINDOW
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the fix without which the transcript will be printed on the command window in which PyFluent script is being run, thus making it unusable.

Copy link
Contributor

@mkundu1 mkundu1 Dec 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me, the issue is resolved if I add the subprocess.CREATE_NO_WINDOW and remove the start.exe without changing in the shell parameter. I'll update the PR after testing different modes.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @mkundu1.

Copilot AI review requested due to automatic review settings November 28, 2025 11:20
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings November 28, 2025 11:24
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings November 28, 2025 15:02
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

else:
# Using 'start.exe' is better; otherwise Fluent is more susceptible to bad termination attempts.
self._launch_cmd = 'start "" ' + self._launch_string
self._launch_cmd = self._launch_string
Copy link

Copilot AI Nov 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since shell=True has been removed from subprocess calls, ensure that self._launch_string is now a list of arguments rather than a string. Passing a string to subprocess.Popen without shell=True will fail. The code should convert the command string to a list using shlex.split() or similar.

Copilot uses AI. Check for mistakes.
else:
# Using 'start.exe' is better; otherwise Fluent is more susceptible to bad termination attempts.
self._launch_cmd = 'start "" ' + self._launch_string
self._launch_cmd = self._launch_string
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mkundu1, this part was the one causing issue. Adding "start" to run it via start.exe needed the shell to be True, and with shell=True there was no option to make the window hidden. This fix works but I wanted to check the reason for introducing "start" in the first place. Can we work with this fix or is there a way to use start and shell=False simultaneously?

cc. @seanpearsonuk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Issue, problem or error in PyFluent

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"no_gui_or_graphics" opens a windows which shows transcript log

5 participants