Fix bild status line output not overwriting properly

t-l6kc73wk·WorkTask·
·
·
·Omni/Bild.hs
Created3 months ago·Updated3 months ago

Description

Edit

Problem

When running bild, status lines show on multiple lines instead of being overwritten in place:

ϟ bild Omni/Test.hs

[…] Omni/Test.hs


[✓] Omni/Test.hs

The expected output should only show the final [✓] Omni/Test.hs with the […] status being overwritten.

Root Cause

The issue is in the interaction between two separate withLineManager calls in the build pipeline:

1. analyzeAll (Omni/Bild.hs:564) creates a LineManager and:

  • Calls initializeLines showing [+] status
  • Calls updateLineState namespace Pending (line 832) showing […]
  • When finished, exits withLineManager which prints a final newline (Concurrent.hs:62)

2. build (Omni/Bild.hs:1167) creates a NEW LineManager and:

  • Calls initializeLines again
  • Eventually shows [✓] or [x]

In SingleLine mode (Omni/Log/Concurrent.hs:57-65), the problem is:

  • Line 62: IO.hPutStrLn IO.stderr "" adds a final newline when exiting the first manager
  • The second manager's output therefore starts on a NEW line instead of overwriting

For transient states like Pending, the code (line 180) deliberately does NOT print a newline, expecting subsequent output to overwrite. But the manager's cleanup newline breaks this assumption.

Affected Files

  • Omni/Log/Concurrent.hs - The withLineManager and updateLineState functions
  • Omni/Bild.hs - The analyzeAll (line 564) and build (line 1167) both create separate line managers

Potential Fixes

1. Merge managers: Have analyzeAll and build share a single LineManager context instead of creating separate ones

2. Remove cleanup newline in SingleLine: Change line 62 to not print a newline when in SingleLine mode (but this might leave cursor in wrong position)

3. Track pending state: Have the manager track if last output was transient, and not add cleanup newline in that case

4. Restructure flow: Combine analyze and build into a single withLineManager block in the move function

Timeline (0)

No activity yet.