Skip to content

[engine-surface] Bare rubash.exe interactive on a real console is a placeholder REPL: banner + hardcoded '$ ' prompt, --rcfile PS1 ignored (GNU renders PS1 via readline) #419

Closed

Description

@caomengxuan666

Found by wt53/themesweep (2026-10-03) while building the ConPTY render harness: driving target/release/rubash.exe --rcfile <omb-rc> -i over a real console produces

Rubash - A Rust implementation of GNU Bash
Type 'exit' to quit.

$

regardless of theme: the rcfile IS sourced (theme functions load) but the prompt is the hardcoded print!("$ ") and the loop is line-based std::io::stdin().read_line.

Location

  • src/main.rs:1134 if io::stdin().is_terminal() { run_repl(executor); } inside run_no_script_with_init - i.e. the --rcfile -i path on a console.
  • src/main.rs:1190 run_repl(): banner println + hardcoded "$ " + no PS1 expansion, no readline editing, no job-aware prompt redraw.
  • The engine's real PS1-rendering reader, script_driver.rs:2776 run_interactive_stdin (readline port: expanded PS1 on stderr, echo, isearch), is only reached when stdin is NOT a terminal (main.rs:1136-1140).

GNU behavior: bash --rcfile rc -i on any console renders PS1 (theme prompt) via readline - the terminal IS the product surface for standalone bash.

Why it matters

Product hosts (niu) drive their own editor and are unaffected, but standalone rubash.exe in a console (double-click, CI debugging, direct use) shows no theme at all and no line editing. The themesweep render leg had to pipe stdin through a relay to reach the PS1-rendering path - see harness note in target/issue-suites/results/themesweep/THEMES-SWEEP.md.

Reproducer

Spawn rubash.exe --rcfile -i under any ConPTY (e.g. pywinpty): screen shows banner + '$ ' (stream: target/issue-suites/results/themesweep/render/dbg + the first smoke runs under render/rb before the relay switch).

Decision needed (owner): either wire run_repl's console branch through run_interactive_stdin/readline, or declare console-standalone out of scope for the engine and document it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1-highbug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions