Do not autoexpand tilde sign (~) to an absolute home directory path
I'm using Syncthing in a dualboot environment, sharing the same keys/config between operating systems. Everything works great. Paths to the shared directories are unified through symlinking in the home directory. However, the GUI doesn't allow entering the tilde ~ on adding folders, autoexpanding it to absolute form, thus requiring manual config editing. If entered manually, the tilde persists and creates no issues with Syncthing.
At some moment my config was changed (may be after some upgrade?) and the path was expanded to the absolute form on Windows, leading to silent creation of the directory on GNU/Linux and redownloading of the contents. I didn't notice it right away so was a bit annoyed.
It would be nice if the GUI didn't have this behaviour and left the ~ untouched.
I would also like to have this feature but for another reason. Basically, it would make backing the config up and restoring it later easier, without any need to modify the paths even if the relevant user account has changed.
You can find the code responsible for the expansion by searching for expandTilde in https://github.com/syncthing/syncthing/blob/main/gui/default/syncthing/core/syncthingController.js.
It sounds strange that your Windows instance created the folder, if you shared the config and database between OSes. In that case, it should have noticed the folder marker missing and stopped the folder with an appropriate error message. So at least that shouldn't pose an immediate problem, but the other arguments still make a valid case for this enhancement.
It sounds strange that your Windows instance created the folder, if you shared the config and database between OSes. In that case, it should have noticed the folder marker missing and stopped the folder with an appropriate error message. So at least that shouldn't pose an immediate problem, but the other arguments still make a valid case for this enhancement.
That's not exactly what happened. I suspect the path in the config was somehow changed while running Windows, and then Syncthing on GNU/Linux happily created a folder with a Windows absolute path for the name.
The point is, if an existing folder happens to point to a different path when Syncthing starts, it will stop with an error because the folder marker is missing at that path (or the path itself doesn't exist). It should not create the folder path, that is only done when initially adding a folder to the config. Are you certain that Syncthing did create the folder? Can you reproduce this? Then it might be a real bug, separate from this enhancement request.