NatLabRockies / NatLabRockies/r2x-cli

fix(read): stop forcing IPython Linux theme on Windows prompts

Open
#158 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug workon-ready
Dominant language
Rust
Stars
4
Forks
2
Avg merge
1d 4h
Merged PRs (30d)
12

Description

fix(read): stop forcing IPython Linux theme on Windows prompts

Current behavior

On Windows PowerShell and Command Prompt, r2x read can leave subsequent IPython input text black after some successful commands, making the prompt unreadable until text is highlighted or an error redraws terminal colors. Startup also emits UserWarning: highlighting_style is deprecated since 9.0 and have no effect, use themeing from IPython 9.15. The generated read bootstrap in crates/r2x-cli/src/commands/read.rs sets cfg.TerminalInteractiveShell.highlighting_style = "monokai" and cfg.TerminalInteractiveShell.colors = "Linux" before creating InteractiveShellEmbed.

Desired behavior or Goal

r2x read should use IPython 9-compatible theme/color configuration and should not force the Linux/monokai prompt theme on Windows terminals. Windows PowerShell and Command Prompt sessions should keep readable input text after successful commands and should not emit r2x-caused IPython 9 color deprecation warnings.

Acceptance criteria

  • Launching r2x read <system.json> with IPython 9.x no longer emits the highlighting_style is deprecated since 9.0 and have no effect warning from r2x-managed configuration.

  • On Windows PowerShell and Command Prompt, r2x read does not force TerminalInteractiveShell.colors = "Linux"; it either uses IPython defaults or an explicit Windows-safe theme/color choice.

  • Representative successful commands in the embedded shell, including %r2x_help, sys, sys.info(), and a simple Python expression, leave the next prompt/input readable without manual highlighting or forcing an exception redraw.

  • The generated read bootstrap removes or version-gates TerminalInteractiveShell.highlighting_style so IPython 9 sessions do not rely on a deprecated no-op setting.

  • A regression test covers the generated bootstrap/configuration path so the deprecated highlighting setting and unconditional Linux theme override are not reintroduced.

Non-goals

  • Do not redesign the entire embedded IPython shell or prompt system.

  • Do not pin or downgrade IPython as the primary fix.

  • Do not change r2x-core, infrasys, or Rich unless Windows smoke evidence proves they emit an unbalanced black foreground sequence.

  • Do not attempt to guarantee every third-party terminal color scheme, only Windows PowerShell and Command Prompt behavior reported here plus sane defaults.

Work Plan

Validation
  • Add a focused unit test for the r2x read bootstrap/configuration generation path that asserts IPython 9 does not receive TerminalInteractiveShell.highlighting_style and Windows does not receive an unconditional Linux theme override.

  • Run a Windows manual smoke check in both PowerShell and Command Prompt with IPython 9.x and latest r2x-core: r2x read <small-system.json>, execute %r2x_help, sys, sys.info(), and 1 + 1, then verify the next prompt/input remains readable.

  • Run git diff --stat main -- crates/r2x-cli/src/commands/read.rs crates/r2x-cli/tests to confirm the PR stays scoped to the read bootstrap and tests.

Documentation
  • Update README or command help only if the fix introduces a user-facing environment variable or documented theme/color behavior.

  • Document the Windows PowerShell and Command Prompt smoke result in the PR body because terminal color regressions are partly visual.

Testing
  • Add or update Rust tests matching existing read.rs test style for generated IPython bootstrap configuration.

  • Run the targeted r2x-cli read-related tests after the code change.

Risks

Breaking-change

Low. This should only change embedded IPython color/theme configuration for r2x read and remove use of a deprecated no-op setting.

Review-size

Low. The likely change is localized to crates/r2x-cli/src/commands/read.rs and focused read tests.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in crates/r2x-cli/src/commands/read.rs, where the generated IPython bootstrap configures highlighting_style and colors, then inspect existing read-related tests under crates/r2x-cli/tests. Add a focused regression test for the generated configuration and run the targeted r2x-cli read tests. Done means IPython 9 receives no deprecated highlighting setting, Windows is not forced to use the Linux theme, and the listed smoke commands leave input readable.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, rust
Domain
cli, testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.