-
Notifications
You must be signed in to change notification settings - Fork 57
fix: Pop up window for launch fluent. #4670
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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=Truefrom subprocess calls to avoid shell-related popup issues - Added
CREATE_NO_WINDOWflag 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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @mkundu1.
There was a problem hiding this 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>
There was a problem hiding this 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.
…com/ansys/pyfluent into fix/pop_up_window_for_launch_fluent
There was a problem hiding this 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 |
Copilot
AI
Nov 28, 2025
There was a problem hiding this comment.
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.
| 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 |
There was a problem hiding this comment.
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
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.