runtime(sh): Update syntax, highlight escaped chars in test expressions

Highlight escape characters in unquoted test expression operands.

E.g., [[ foo == \[bar\] ]]

fixes #17221

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Doug Kearns
2025-04-30 20:04:28 +02:00
committed by Christian Brabandt
parent ff3d4b2d49
commit f57c065e75
3 changed files with 30 additions and 1 deletions

View File

@ -0,0 +1,8 @@
#!/bin/bash
# Issue #17221 (sh syntax: escaped square brackets don't work in [[ ]])
[[ foo == [bar] ]]
[[ foo == \[bar\] ]]
echo [foo]
echo \[foo\]