Skip to content

Text has ANSI styling (no reset) before prompt is printed #16384

Closed
nushell/reedline
#992

Description

@davidkna

Describe the bug

Unlike other shells including fish, bash and zsh string in the prompt are colored, because the color is not reset (or set to non-default value).

Image

starship/starship#6560

How to reproduce

starship/starship#6560

Use bare string at the start of the prompt and observe its color.

Expected behavior

Before prompt is printed, color is reset ("\x1b[0m").

Configuration

key value
version 0.106.1
major 0
minor 106
patch 1
branch
commit_hash
build_os macos-aarch64
build_target aarch64-apple-darwin
rust_version rustc 1.88.0 (6b00bc388 2025-06-23) (built from a source tarball)
cargo_version cargo 1.88.0 (873a06493 2025-05-10)
build_time 1980-01-01 00:00:00 +00:00
build_rust_channel release
allocator standard
features default, plugin, rustls-tls, sqlite, trash-support
installed_plugins
experimental_options example=false, reorder-cell-paths=false

Activity

  1. added
    status:needs-triage
    on Aug 7, 2025
  2. fdncred commented on Aug 7, 2025

    @fdncred
    Contributor

    Yup, I've seen this before. Sorry. Definitely a bug. I think it's in reedline somewhere.

  3. added
    category:bug
    on Aug 7, 2025
  4. ysthakur commented on Aug 7, 2025

    @ysthakur
    Member

    Seems like we simply have to print an ANSI reset before printing the rest of the prompt? Should be a very easy fix.

    The prompt is printed around here in Reedline, if anyone wants to give it a go: https://github.com/nushell/reedline/blob/main/src/painting/painter.rs#L256

  5. AnandajithS commented on Aug 8, 2025

    @AnandajithS
    Contributor

    Hi. I would like to work on this issue

  6. fdncred commented on Aug 8, 2025

    @fdncred
    Contributor

    go for it. thanks!

  7. davidkna commented on Aug 10, 2025

    @davidkna
    Author

    Per a report on the starship discord, this also appears to be an issue with right prompts.

  8. AnandajithS commented on Sep 16, 2025

    @AnandajithS
    Contributor

    The issue seems to be that the DEFAULT_PROMPT_COLOR defined in https://github.com/nushell/reedline/blob/main/src/prompt/base.rs#L12 where it is set to Green. By changing it like thispub static DEFAULT_PROMPT_COLOR: Color = Color::Reset; ,the colors are reset and the prompt inherits the terminal's default colors unless configured otherwise

  9. fdncred commented on Sep 16, 2025

    @fdncred
    Contributor

    The issue seems to be that the DEFAULT_PROMPT_COLOR defined in https://github.com/nushell/reedline/blob/main/src/prompt/base.rs#L12 where it is set to Green. By changing it like thispub static DEFAULT_PROMPT_COLOR: Color = Color::Reset; ,the colors are reset and the prompt inherits the terminal's default colors unless configured otherwise

    Seems plausible. Someone just needs to submit a PR for us to try it out.

  10. added a commit that references this issue on Dec 29, 2025
    4cce77d
  11. iniw commented on Feb 18, 2026

    @iniw

    Note that starship/starship#6560 is somehow still not fixed even after v0.110.0, which contains nushell/reedline#992

  12. added a commit that references this issue on Jun 1, 2026
    1f86f6f
  13. added 2 commits that reference this issue on Jul 25, 2026
    46226e4
    15742cb
  14. added a commit that references this issue on Nov 14, 2026
    f861a79
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

category:buggood first issuestatus:needs-triage

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions