@@ -63,12 +63,26 @@ The ``.stignore`` file contains a list of file or path patterns. The
63
63
64
64
.. note ::
65
65
66
- Escaped characters are not supported on Windows, where ``\ `` is the
67
- path separator. If you still need to match files that have square or
68
- curly brackets in their names, one possible workaround is to replace
69
- them with ``? ``, which will then match any character. For example,
70
- you can type ``?banana? `` to match both ``[banana] `` and
71
- ``{banana} ``, and so on.
66
+ On Windows, ``\ `` is the path separator, so use ``| `` to escape special
67
+ characters. For example, ``|{banana|} `` matches
68
+ ``{banana} ``.
69
+
70
+ To use ``\ `` to escape special characters (and use ``/ `` as the path separator),
71
+ insert a ``#escape=\ `` at the top of the file. Here's a short example:
72
+
73
+ | ``#escape=\``
74
+ | ``/foo``
75
+ | ``/path/bar/\{banana\}``
76
+ | ``/path/baz\[2\]/ex\[3\].txt``
77
+
78
+ ``#escape=\ `` must be placed at the top of the file, before any patterns,
79
+ but leading comments, and blank lines are OK.
80
+
81
+ Any files included using ``#include `` (see below) will each need their
82
+ own ``#escape=\ ``.
83
+
84
+ Using ``#escape=\ `` allows the same file to be synced and used on any
85
+ operating system.
72
86
73
87
- A pattern beginning with ``/ `` matches in the root of the synced folder only.
74
88
``/foo `` matches ``foo `` but not ``subdir/foo ``.
@@ -190,3 +204,10 @@ all files and directories called "foo", ending in a "2" or starting with
190
204
accepting a folder from a remote device. The GUI suggests the same patterns
191
205
when adding a folder manually. In either case, the ``.stignore `` file is
192
206
created with these defaults if none is present yet.
207
+
208
+ .. versionadded :: 2.0.0
209
+
210
+ Windows users can now use the pipe character (``| ``) to escape
211
+ metacharacters in the ``.stignore `` file. Additionally, adding
212
+ ``#escape=X `` to the top of the file, allows users to define ``X ``
213
+ as the escape character for that particular file.
0 commit comments