Skip to content

fix(plugins): match show/hide patterns regardless of case - #3812

Merged
nicolargo merged 1 commit into
nicolargo:developfrom
LuisFigueroaG:fix/show-hide-ignore-case
Oct 23, 2026
Merged

nicolargo merged 1 commit into
nicolargo:developfrom
LuisFigueroaG:fix/show-hide-ignore-case

Conversation

@LuisFigueroaG

Copy link
Copy Markdown
Contributor

Description

v4 compiled the show/hide patterns with re.I (plugin/model.py is_show/is_hide), so they matched an item whatever its case. The v5 collection filter compiles them case-sensitive, so a config that worked on v4 now silently filters nothing. This shows up with mixed-case names such as Windows interfaces (Ethernet 2, Wi-Fi), container names or sensor labels:

[network]
hide=LO,DOCKER.*

$ glances -C glances.conf --stdout-csv network --stop-after 1
develop: lo, eno1, wls2 and docker0 are all listed
this PR: only eno1 and wls2

_compile_filter() takes an optional flags argument, and only show/hide pass re.IGNORECASE. The [processlist] export filter, which uses the same helper, keeps its case-sensitive match like in v4. Matching still uses re.search, and aliases were already matched case-insensitively.

Tested with a new parametrized case in tests/test_plugin_base.py, which fails on develop. Test suite and pre-commit pass.

Resume

  • Bug fix: yes
  • New feature: no
  • Fixed tickets: none

v4 compiled the show/hide regexes with re.I, so hide=ethernet.* hid
"Ethernet 2". The v5 collection filter compiled them case-sensitive,
so such a config silently stopped filtering. Only show/hide get the
flag: the processlist export filter keeps its v4 case-sensitive match.
@nicolargo nicolargo added this to the Glances 5.0.0 milestone Oct 23, 2026
@nicolargo
nicolargo merged commit b52f35e into nicolargo:develop Oct 23, 2026
18 of 19 checks passed
@nicolargo

Copy link
Copy Markdown
Owner

Thanks @LuisFigueroaG

Merged into develop !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants