Add a note of caution about using shared regex in provideTerminalLinks
#101458
Labels
insiders-released
Patch has been released in VS Code Insiders
polish
Cleanup and polish issue
terminal
General terminal issues that don't fall under another label
Milestone
Testing #101300
If an extension uses a shared RegExp instance with the
global
flag inprovideTerminalLinks
withawait
calls , it could lead to unexpected results. This is because a RegExp object withglobal
flag maintains state as you loop over the matches, and if there are anyawait
calls inside that loop, another call toprovideTerminalLinks
could be executed, re-using that same RegExp instance -- effectively mixing/corrupting the results.Since IMO, RegExp parsing (especially with the
global
flag) will likely be common within this API, I think it is worth a note of caution.The text was updated successfully, but these errors were encountered: