Repository navigation
Add network output highlighting (Generic, Cisco IOS, Junos, Huawei VRP) - #1345
Open
carlosjaribeiro wants to merge 2 commits into
Open
carlosjaribeiro wants to merge 2 commits into
carlosjaribeiro wants to merge 2 commits into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds opt-in, colour-only highlighting of network-device output in the terminal (IPs, prefixes, MACs, VLANs, interfaces, link state, error lines), as discussed in #1265. Built-in profiles: Generic, Cisco IOS, Junos and Huawei VRP.
docs/highlighting.md, linked fromdocs/README.md..mofiles are regenerated withmsgfmt --check, asdocs/development/localization.mddescribes (new entries are untranslated).Closes #1265
Design notes
terminal_highlight.py, pure Python, nogiimport) plus a small hook interminal.py. The hook is a no-op when the feature is off.API and architecture
terminal.*default settings are added)docs/api/CHANGELOG.mdwas updatedNo API artifacts change;
scripts/generate_api_artifacts.py --checkconfirms they are current.Testing
ruff check src/ tests/ scripts/generate_api_artifacts.py(Ruff 0.15.17): passedpython scripts/generate_api_artifacts.py --check: passedpytest -q tests/api tests/architecture tests/test_terminal_highlight.py: 1,197 passedpytest -ra(full suite): 9,847 passed, 131 skipped, 6 xfailed, 1 xpassed, 5 failed. Pristineupstream/devhas the same five failures here (unavailablemsgfmt, libvterm ABI guard, inode-replacement and daemon-socket race checks)..github/workflows/lint.yml: passed for all eight catalogs.show running-config,show logging), and opened the Preferences controls under WSLg. That was done with a downstream build that contains this code plus additional profiles, not with this exact branch alone.Not run: opt-in integration, GUI, E2E, stress and property suites; the Windows and macOS CI jobs; real-GTK tests. The Junos and Huawei VRP profiles are built from vendor documentation and sample output and have not been checked against real devices. Not tested on macOS.
Known limitations
If you would like a different scope, settings layout or profile set, I am happy to adjust.