Skip to content

fix(v2): strip ANSI escape sequences and use LC_ALL=C in apt PackageInstalled#5184

Draft
leaanthony wants to merge 2 commits intomasterfrom
v2-bugfix/4258-apt-escape-sequences
Draft

fix(v2): strip ANSI escape sequences and use LC_ALL=C in apt PackageInstalled#5184
leaanthony wants to merge 2 commits intomasterfrom
v2-bugfix/4258-apt-escape-sequences

Conversation

@leaanthony
Copy link
Copy Markdown
Member

Problem

wails doctor incorrectly reports libgtk-3-dev and libwebkit2gtk-4.0-dev as not installed on some Debian/Ubuntu systems where apt list -qq output includes ANSI escape codes or the locale is non-English.

Closes #4258

Changes

  • Strip ANSI escape sequences from apt list output in PackageInstalled (using the existing removeEscapeSequences method already used by PackageAvailable)
  • Replace LANGUAGE=en with LC_ALL=C for more robust locale forcing

Testing

  • Verified the removeEscapeSequences regex correctly strips ANSI codes from colored apt output
  • The strings.Contains check for [installed] already handles all variants: [installed], [installed,local], [installed,automatic], [installed,upgradable to: X.Y.Z]

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 19, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: daf71fd6-cd96-41ab-b0f2-3263526531ec

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch v2-bugfix/4258-apt-escape-sequences

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

… check

Tests revealed that strings.Contains(output, "[installed]") fails for
apt variants like [installed,local] and [installed,automatic] because
the closing bracket doesn't match. Changed to search for "[installed"
(without closing bracket) to match all installed-state variants.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wails doctor reports library of libgtk-3-dev and libwebkit2gtk-4.0-dev incorrectly

1 participant