REPL: supply a contrasting history region foreground - #63237
abhinav-phi wants to merge 2 commits into
Conversation
The history searcher paints the hovered candidate row and the preview-box selection with the :region face, which only sets a background. Terminals that leave the foreground at its default render dark text on the dark region background, unreadable on light backgrounds. Applying :inverse alongside :region flips the foreground with the background, so the hovered content contrasts on both light and dark terminals. Reverse video (SGR 7) is universally supported, preserving terminal compatibility. The mode hint already combined region with inverse; this extends the same treatment to the candidate row, its age decoration, and the preview-box selection. Fixes JuliaLang#63101. Assisted-by: OpenCode (opencode/muse-spark-1.3-contributor-free)
|
Hi, this update adds the REPL-local inverse-based fix for #63101. I applied I could not run Julia or terminal checks locally, so the PR lists manual verification steps for light and dark backgrounds and still needs CI plus reviewer checks. Thanks. Related issue: #63101 |
|
Hi eschnett and fingolfin, this PR is ready for review whenever convenient. Two notes on the failing CI, from the attached logs. The No backport is included. Please let me know if you read the REPL failure differently, want the job re-run, or would like any changes. Thanks. |
Reverse video exchanges the same low-contrast color pair. Supply a background-aware fallback beneath existing syntax styling and the configured region face, without forcing inverse video or changing the shared region defaults. Fixes JuliaLang#63101. Assisted-by: ZCode (Union Alpha)
The history searcher applies the background-only
:regionface to hovered content, which can leave terminal-default dark text against a dark selection background. This PR supplies a contrasting foreground fallback locally in the history display, without changing the shared region defaults.The original commit added
:inverse, but that swaps the same color pair and does not establish better contrast. Commitfcd37f52b2replaces that approach. The fallback chooses black or white from the resolved region background's relative luminance and sits beneath existing syntax annotations and the final configured region face. Explicit syntax colors and customized region foregrounds therefore retain precedence. The candidate row, age decoration, and hovered selected-preview content use the same helper. The change does not force reverse video; a user-configured inverse value remains respected.Verification
The checkout's modified
display.jlwas explicitly loaded intoREPL.Historyusing a portable Windows Julia nightly, version1.14.0-DEV.3247, runtime commit272aa7e2a0f6786b6c5a0d3cd6e7619386e01222. This was not a full Julia build from this branch.stdlib/REPL/test/history.jlpassed 200 assertions, including 15 new checks for fallback colors, custom foreground/background/inverse preservation, syntax-color preservation, and rendered candidate output.--compiled-modules=no --check-bounds=yes --startup-file=noandJULIA_TEST_FAILFAST=1.display.jlfrom old PR head21fb35facdand the corrected checkout in separate runtime processes. Both rendered the same selected hovered row with a region background of#636363. Resolving their emitted ANSI colors against black-on-white terminal defaults gives plain-text contrast of 3.495:1 before and 6.008:1 after; against white-on-black defaults it remains 6.008:1. This is a color calculation for the tested plain-text case, not visual terminal verification or a guarantee for customized syntax palettes.git diff --checkpassed before commit.The full REPL suite was attempted with bounds checking but stopped in
replcompletions.jl:1356: Windows denied creation of a self-referencing symbolic link withEPERM. It did not complete. No interactive WezTerm or iTerm2 verification, light/dark terminal screenshots, or full source build is claimed. The helper preserves explicit syntax colors rather than guaranteeing contrast for every possible user palette.CI and review limitations
The previous head's Buildkite checks failed. The LLVM test log shows a malformed plugin-library argument followed by a load failure; the macOS test log shows a REPL worker segmentation fault. Neither failure has a base-commit comparison establishing that it is unrelated to this PR. The earlier categorical claim that those failures were unrelated or environmental was too strong. New-head CI and maintainer review remain necessary.
The REPL-local scope is a proposal, not an approved maintainer decision. No backport is included. This contribution used substantial AI assistance, including the follow-up implementation and test work; the follow-up commit discloses ZCode (Union Alpha).
Fixes #63101.