Skip to content

fix(search): fall back to TSV when gum table rejects input (#148)#149

Open
olavostauros wants to merge 1 commit into
KnickKnackLabs:mainfrom
olavostauros:fix/148-search-gum-fallback
Open

fix(search): fall back to TSV when gum table rejects input (#148)#149
olavostauros wants to merge 1 commit into
KnickKnackLabs:mainfrom
olavostauros:fix/148-search-gum-fallback

Conversation

@olavostauros

Copy link
Copy Markdown
Collaborator

Summary

When note titles, body snippets, or metadata contain characters that
gum table cannot parse (tabs, newlines), notes search crashes
with CalledProcessError. This is a presentation-only failure — the
search results are correct. The same bug affects notes list.

Changes

  • Sanitize cells: Replace tabs with spaces and newlines with ⏎
    before passing data to gum.
  • Fallback: If gum still fails (or is missing), print the results
    as plain tab-separated text instead of crashing.
  • --json output is unaffected (bypasses gum entirely).
  • Applied same fix to .mise/tasks/list (identical gum table pattern).

Design decisions

Decision Choice
Missing gum Soft fallback to TSV, not a hard error
Newline replacement is acceptable; --json is the contract for machine consumption
Sanitization timing After joining final cell value, not per-element
Test tab survival python3 -c heredoc for reliable literal tab character

Validation

  • bats test/search.bats — all 6 tests pass (1 new)
  • bats test/list.bats — all 13 tests pass
  • git diff --check

Closes #148

…kLabs#148)

Sanitize cell values (tabs→spaces, newlines→⏎) and wrap gum table call in try/except to fall back to plain TSV on failure. Apply same fix to notes list. Add test for unusual-character input.
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.

notes search should not hard-fail when gum table rejects output

1 participant