-no-console can not work #20217

Closed
opened 2026-01-31 07:06:50 +00:00 by claunia · 3 comments
Owner

Originally created by @Astro-Aionia on GitHub (Jul 12, 2023).

Windows Terminal version

1.17.11461.0

Windows build number

10.0.19045.3086

Other Software

I find this bug when using Syncthing, but I'm sure this bug can reproduce with any CLI programs

Steps to reproduce

run a CLI program with a parameter -no-console

e.g., I write this bat file to run Syncthing without console window:

start "Syncthing" syncthing.exe -no-console -no-browser

Expected Behavior

Launch the program and close the tab immediately.

Actual Behavior

It will open a new tab and keep the screen output. But in cmd it wil close the cmd window

Originally created by @Astro-Aionia on GitHub (Jul 12, 2023). ### Windows Terminal version 1.17.11461.0 ### Windows build number 10.0.19045.3086 ### Other Software I find this bug when using Syncthing, but I'm sure this bug can reproduce with any CLI programs ### Steps to reproduce run a CLI program with a parameter `-no-console` e.g., I write this bat file to run Syncthing without console window: ``` start "Syncthing" syncthing.exe -no-console -no-browser ``` ### Expected Behavior Launch the program and close the tab immediately. ### Actual Behavior It will open a new tab and keep the screen output. But in cmd it wil close the cmd window
claunia added the Issue-BugResolution-Duplicate labels 2026-01-31 07:06:50 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Jul 12, 2023):

This is definitely a dupe, but it's hard to say where to exactly. Here are some notes:

  • downstream: https://github.com/syncthing/syncthing/issues/8046
  • #12464
    • This is the thread I think is probably the most relevant.
    • There's another note in #13392 too.
  • #7335
    • notable mention here.
    • I'm guessing that syncthing is a CONSOLE subsystem exe. I'm guessing that folks are running it from like, a shortcut, or the run dialog - basically, from something that can't just call CreateProcess with specific flags.
    • There's gotta be some commandline that'll launch a console app hidden. Idly, I wonder if cmd.exe /c start /min "Syncthing" syncthing.exe -no-console -no-browser would work.
      • That should cause defterm to not handoff for the "minimized" syncthing.exe launch. Once syncthing is launched in conhost, it should be able to SW_HIDE its console window. A Terminal window might still flash on screen (for the cmd.exe), but it should disappear quick.
@zadjii-msft commented on GitHub (Jul 12, 2023): This is definitely a dupe, but it's hard to say where to exactly. Here are some notes: * downstream: https://github.com/syncthing/syncthing/issues/8046 * #12464 - This is the thread I think is probably the most relevant. - There's another note in #13392 too. * #7335 - notable mention here. - I'm guessing that `syncthing` is a CONSOLE subsystem exe. I'm guessing that folks are running it from like, a shortcut, or the run dialog - basically, from something that can't just call `CreateProcess` with specific flags. - There's gotta be _some_ commandline that'll launch a console app hidden. Idly, I wonder if `cmd.exe /c start /min "Syncthing" syncthing.exe -no-console -no-browser` would work. - That _should_ cause defterm to not handoff for the "minimized" syncthing.exe launch. Once syncthing is launched in conhost, it should be able to SW_HIDE its console window. A Terminal window might still flash on screen (for the `cmd.exe`), but it should disappear quick.
Author
Owner

@PankajBhojwani commented on GitHub (Jul 12, 2023):

Thank you for submitting the issue! We've determined this is a /dup #12464

@PankajBhojwani commented on GitHub (Jul 12, 2023): Thank you for submitting the issue! We've determined this is a /dup #12464
Author
Owner

@microsoft-github-policy-service[bot] commented on GitHub (Jul 12, 2023):

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@microsoft-github-policy-service[bot] commented on GitHub (Jul 12, 2023): Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#20217