Skip to content

Incorrect syntax highlighting #271984

@anewhouse

Description

@anewhouse

Type: Bug

In the following Shell Script code, the until on line 9 doesn't have the scope keyword.control.shell like it should - the first letter, "u", is meta.statement.shell, and the rest of the word has the scope string.unquoted.shell

# Make sure the computer is connected to power if the battery is under 30%
if pmset -g ps | grep -q "Battery Power" && [[ $(pmset -g ps | grep -Eo "\d+%" | cut -d% -f1) -lt 30 ]]; then
	addLog "Battery is below 30%, waiting for AC power..."
	/usr/local/bin/dialog --commandfile "/var/tmp/macSetupBattery.log" \
		--icon caution --iconsize 64 --centericon --title none \
		--message "Please connect your laptop to a power source to continue" \
		--messagefont "size=16" --messageposition center --messagealignment center \
		--button1text none --width 500 --height 175 --quitkey X --ontop --position center &
	until pmset -g ps | grep -q "AC Power"; do
		sleep 2
	done
	addLog -nested "AC power detected"
	echo "quit:" > /var/tmp/macSetupBattery.log
	updateDialog "show:"
fi

VS Code version: Code 1.105.1 (Universal) (7d842fb, 2025-10-14T22:33:36.618Z)
OS version: Darwin arm64 25.0.0
Modes:

System Info
Item Value
CPUs Apple M3 (8 x 2400)
GPU Status 2d_canvas: enabled
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: enabled_on
trees_in_viz: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) 3, 3, 3
Memory (System) 16.00GB (0.07GB free)
Process Argv
Screen Reader no
VM 0%
Extensions (7)
Extension Author (truncated) Version
binary-plist dni 1.0.2
vscode-edit-csv jan 0.11.7
rainbow-csv mec 3.23.0
powershell ms- 2025.4.0
vscode-xml red 0.29.0
vscode-yaml red 1.19.1
kuskus-kusto-syntax-highlighting ros 2.0.5

Metadata

Metadata

Assignees

Labels

grammarSyntax highlighting grammarupstream-issue-linkedThis is an upstream issue that has been reported upstream

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions