nushell / nushell/reedline

How should output be done ideally?

Open
#836 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Rust
Stars
818
Forks
249
Avg merge
4d 14h
Merged PRs (30d)
30

Description

I see in the examples that the println! macro is used directly for output, but using this or even print! flushes stdout before printing the next prompt, and this doesn't look pleasant.

a

In the GIF, you can see the cursor move to the next line after printing from println! and then go down again after printing the next prompt.
(Open GIF in a new tab if it isn't clear)

I think we should have an API for printing command outputs so there's no flush before the next prompt is printed. Maybe we could also have an output "prompt", which popular REPLs like ipython doo.
2024-09-28-171502_screenshot

Contributor guide

Open the contributing guide

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 by reviewing the examples that use println! and print!, then reproduce the prompt and output behavior described in the issue. Determine the desired output API and whether an output prompt is in scope; the work is done when the chosen behavior is implemented and the cursor no longer moves through an unwanted intermediate line.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.