Skip to content

Statusline on Linux: memory line stuck on "JUST NOW" because last-review age is parsed with BSD-only date -j #2260

Closed as not planned

Description

@drpaulobernardy

What happens

On Linux the statusline's 🧠 memory line never shows the real age of the last memory review. After any review that wrote something, it stays stuck on SAVED N NEW MEMORIES JUST NOW until a health warning replaces it.

Cause

LifeOS/install/LIFEOS/LIFEOS_StatusLine.sh:1879 parses last_review_at with BSD-only flags:

_then_epoch=$(date -u -j -f "%Y-%m-%dT%H:%M:%S" "${_mem_last_review%.*}" +%s 2>/dev/null || echo "$NOW_EPOCH")

GNU date rejects -j (date: invalid option -- 'j'), the fallback returns $NOW_EPOCH, the age becomes 0, and the -le 30 branch at :1929 keeps printing "JUST NOW".

The script already has a portable parser, parse_iso_epoch() at :224, which switches on DATE_FLAVOR; this line just doesn't use it.

Fix (one line)

_then_epoch=$(parse_iso_epoch "$_mem_last_review"); [ "$_then_epoch" -gt 0 ] 2>/dev/null || _then_epoch="$NOW_EPOCH"

The guard keeps the original fallback, since parse_iso_epoch returns 0 on failure.

Verified

Linux (Arch/Hyprland), GNU coreutils date, LifeOS 7.40.4. The script was run with the same stdin before and after the change:

  • before: 🧠 SAVED 3 NEW MEMORIES JUST NOW · 19% FULL
  • after: 🧠 OK · REVIEWED 10M AGO · NEXT IN 3 TURNS · 19% FULL (the review had been ~10 min earlier)

main still has the BSD-only line.

Activity

  1. danielmiessler commented on Oct 3, 2026

    @danielmiessler
    Owner

    Thanks @drpaulobernardy, and for the before/after output. The memory line itself has since been removed from the statusline (memory status moved off it entirely), so the BSD-only date -j parse went with it. The remaining timestamp parsing in LIFEOS_StatusLine.sh goes through the GNU/BSD switch you pointed to. Next release carries it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions