Skip to content

Conversation

KristofferC
Copy link
Member

This is another version of #51887 (which I didn't know existed until recently) that tries to bring the REPL prompt customization into the post StyledStrings era.

Still need to do some work on it and think about backwards compatbility (some probably needs to be broken) but you can already do something like

using StyledStrings
using Dates
atreplinit() do repl
    # Dynamic prompt with time
    repl.output_prefix = () -> begin
      str = string(Dates.format(Dates.now(), "HH:MM:SS"), "> ")
      styled"{bold,bright_red:$str}"
    end

    # Dynamic prompt with Julia version and styling
    repl.prompt = () -> styled"{bold,magenta:julia v$(VERSION)>} "
end

and get:

image

This is the native version of https://kristofferc.github.io/OhMyREPL.jl/latest/features/prompt/.

cc @caleb-allen

@KristofferC KristofferC marked this pull request as draft October 17, 2025 16:32
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.

1 participant