Repository navigation
fix(prompt): restore the clock in the fallback right prompt - #19613
Conversation
reedline 0.53 dropped its `CurrentDateTime` segment along with chrono, since a clock needs the local timezone and std cannot provide one, and left `DefaultPrompt::default()` with an empty right prompt. Our fallback went through that default, thus `--no-config-file` and a `null` `prompt.right` lost the clock without anyone deciding so. The clock is now ours, rendered with jiff through `DefaultPromptSegment::Dynamic` in the format reedline used.
There was a problem hiding this comment.
Review overview
🟢 Minor suggestions
The clock is back. On 2118887, nu --no-config-file and a config with $env.config.prompt.right = null both show the date and time again, in the local zone (I checked TZ=Asia/Tokyo, UTC and EST5EDT against date), and prompt.right = "" still gives no right prompt. One comment nit left.
Findings: 0
Notes from my clanker, checked on 2118887. Built the branch, ran cargo test -p nu-cli --lib -- prompt:: (7 passed), and drew the first prompt in a PTY on the branch binary and on main 651f0e4 with --no-config-file, several TZ values, prompt.right = null, prompt.right = "" and the default prompts. Didn't run clippy locally. CI's lint jobs passed on this head.
|
Hey, just a bot checking in! You edited files related to the configuration. |



Description
reedline 0.53 dropped its built-in
CurrentDateTimesegment as part of removing chrono (nushell/reedline#1248), since a clock needs the local timezone and std cannot provide one.DefaultPrompt::default()now has an empty right prompt.Nushell falls back to
DefaultPromptwhenever no right prompt is set, so under--no-config-fileor with$env.config.prompt.right = nullthe clock silently disappeared.That was missed when bumping reedline.
The fallback now builds its own
DefaultPromptwith aDefaultPromptSegment::Dynamicclock rendered by jiff, in the same%m/%d/%Y %I:%M:%S %pformat reedline used.The left side stays the working directory.
Sessions with a config are unaffected, since the default right prompt there is still the Nu closure in
DEFAULT_PROMPTS.Tests:
nu-cliprompt::7/7, including a newthe_fallback_right_prompt_is_a_clock.User-facing changes (Release notes)
Fixed the right prompt being empty when running without a config file.
It shows the current date and time again.
Additional notes
Follow-up to the reedline 0.53 bump.