Skip to content

Auto pprint/tprint REPL expression output#2255

Merged
KCarretto merged 2 commits intomainfrom
copilot/update-shell-output-printing
Apr 17, 2026
Merged

Auto pprint/tprint REPL expression output#2255
KCarretto merged 2 commits intomainfrom
copilot/update-shell-output-printing

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 17, 2026

REPL expression return values were formatted with raw {:?} debug output. Now dictionaries auto-pprint and lists of dictionaries auto-tprint, so file.list() renders as a readable table.

Only affects the retval display in execute_interpret — explicit print() calls are unchanged.

Changes

  • pprint.rs: Made pretty_format public
  • tprint.rs: Extracted formatting into format_tprint(value) -> Result<Option<String>, String>, builtin_tprint delegates to it
  • Module visibility: pprint/tprint modules → pub, exported pretty_format and format_tprint through eldritch-coreeldritch
  • manager.rs: New format_value_smart replaces format!("{:?}\n", value) at the expression eval output site:
    • Value::Dictionarypretty_format (indented key-value)
    • Value::List where all elements are dicts → format_tprint (markdown table)
    • Value::List otherwise → pretty_format
    • Everything else → {:?} (unchanged)

Copilot AI and others added 2 commits April 17, 2026 04:10
@KCarretto KCarretto marked this pull request as ready for review April 17, 2026 04:23
@KCarretto KCarretto merged commit 84c6ec2 into main Apr 17, 2026
@KCarretto KCarretto deleted the copilot/update-shell-output-printing branch April 17, 2026 04:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants