Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/changelog.d/4670.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Pop up window for launch fluent.
7 changes: 5 additions & 2 deletions src/ansys/fluent/core/launcher/launcher_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,12 @@ def _get_subprocess_kwargs_for_fluent(env: Dict[str, Any], argvals) -> Dict[str,
stderr=pyfluent.config.launch_fluent_stderr,
)
if is_windows():
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.

)
else:
kwargs.update(shell=True, start_new_session=True)
kwargs.update(start_new_session=True)
fluent_env = os.environ.copy()
fluent_env.update({k: str(v) for k, v in env.items()})
fluent_env["REMOTING_THROW_LAST_TUI_ERROR"] = "1"
Expand Down
10 changes: 1 addition & 9 deletions src/ansys/fluent/core/launcher/standalone_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,14 +236,7 @@ def __init__(
)

if is_windows():
if (
pyfluent.config.launch_fluent_stdout
or pyfluent.config.launch_fluent_stderr
):
self._launch_cmd = self._launch_string
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.
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

else:
if self.argvals["ui_mode"] not in [UIMode.GUI, UIMode.HIDDEN_GUI]:
# Using nohup to hide Fluent output from the current terminal
Expand All @@ -257,7 +250,6 @@ def __call__(self):
return self._launch_string, self._server_info_file_name
try:
logger.debug(f"Launching Fluent with command: {self._launch_cmd}")

process = subprocess.Popen(self._launch_cmd, **self._kwargs)

try:
Expand Down
Loading