Update documentation about --no-console and conhost for Windows

I’m using 2 instances scenario. And I faced with even if I run 1st instance with “syncthing --no-browser --no-console” and it usually closes the window (even I saw it may not close sometimes), second instance command “syncthing --no-browser --no-console --home=%LOCALAPPDATA%\” does not close the console window

I found one of solutions: the usage of “conhost” ( -no-console option does not work when Windows Terminal is set as Default Terminal application · Issue #8046 · syncthing/syncthing · GitHub ) and it works just fine

I think it would be nice to mention “conhost” in Starting Syncthing Automatically — Syncthing documentation page and maybe in Command Line Operation page > –no-console flag

The problem is that most users probably don’t want to disable Windows Terminal and go back to the old console as their default shell. I think we should probably recommend the Task Scheduler way as the main method to run Syncthing hidden, because that one can always hide the console window even without using --no-console with Syncthing.

In other words, the Startup folder solution isn’t really viable anymore, at least not as a general recommendation.

1 Like

Ok, I just set up approach with Task Scheduler:

  • Windows 11
  • Settings > System > For Developers > Terminal = Windows Terminal
  • Task Scheduler >
    • created 2 tasks for “start on logon”
    • syncthing --no-browser --no-console
    • and syncthing --no-browser --no-console --home=%LOCALAPPDATA%\Something
  • restarted the system

as-is: 2 console windows

What I was talking about:

to mention that if you are using “–no-console” you may face with situation of not hiding console windows

in that case usage of conhost helps: “conhost syncthing --no-browser --no-console”

What I meant is that if you follow the method from https://docs.syncthing.net/users/autostart.html#autostart-windows-taskschd and set the task to run whether the user is logged on or not, Syncthing will always start in background even without --no-console.

I see what you mean about using conhost though, I will try to do some testing and possibly update the Docs to use it for the other autostart methods :slight_smile:.

I just added a second shortcut to Startup with different --home and rebooted: no Terminal window. I set Start window: Minimised for the shortcut.

There’s also a

conhost.exe --headless syncthing.exe …

which works for me to hide powershell windows and should also work for syncthing. But it may not be officially supported.

Edit: conhost headless mode is broken · Issue #13914 · microsoft/terminal · GitHub