Skip to content

[BUG] Command zk --list fails to encode correctly #590

@MrDwarf7

Description

@MrDwarf7

Check if applicable

  • I have searched the existing issues (required)
  • I'm willing to help fix the problem and contribute a pull request

Describe the bug

Running zk list from the root after creating a new notebook and a new note (via zk new --title "Wow very cool") fails to correctly encode ascii escape sequences.

Running zk list outputs:

ESC[1;33mWow very coolESC[0m ESC[4;36my48e.mdESC[0m (11 minutes ago)

  ‣ Very interesting **AND** very cool!

ESC[1;33mwowESC[0m ESC[4;36mpr7b.mdESC[0m (5 minutes ago)

  ‣ Some text here!

(END)

Running zk list > t.txt && bat t.txt however will render correctly:

 ❯ zk list > t.txt && bat t.txt

Found 2 notes
───────┬────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
       │ File: t.txt
───────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1   │ Wow very cool y48e.md (12 minutes ago)
   2   │
   3   │   ‣ Very interesting **AND** very cool!
   4   │
   5   │ wow pr7b.md (6 minutes ago)
   6   │
   7   │   ‣ Some text here!
   8   │
───────┴────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

How to reproduce?

  1. zk init zett
  2. zk new --title "wow"
  3. zk list

Observe broken output.
Interestingly, running zk list > wow.txt followed by bat wow.txt will correctly handle the encoding output; displaying the little arrow and the various indentation(s) levels.

zk configuration

Entirely stock - Just installed it and it hasn't generated anything nor have I created one.

Environment

Direct output from copy paste:


zk 0.15.1
system: `uname -srmo`


Likely intended output:


zk 0.15.1
system: Linux 6.17.1-arch1-1 x86_64 GNU/Linux


-----------
prefer using something like: `bash -c 'zk --version && echo "system: `uname -srmo`"'` in your copy-paste block above for shell agnostic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions