rhysd / notes-cli

Small markdown note taking CLI app playing nicely with your favorite editor and other CLI tools
MIT License
212 stars 25 forks source link

BUG filenames with spaces #9

Open blaggacao opened 4 years ago

blaggacao commented 4 years ago

notes new test "My foo Note"

notes ls | fzf | xargs -o typora - trying to open "My foo Note" fails due to the spaces

blaggacao commented 4 years ago

Concrete example:

notes ls
/home/blaggacao/ghq/keybase/team/p1hq/notas/tickets/gitea-bot.md
/home/blaggacao/ghq/keybase/team/p1hq/notas/minutas/Feedback EPs & Todos.md
/home/blaggacao/ghq/keybase/team/p1hq/notas/tickets/k8s.md
/home/blaggacao/ghq/keybase/team/p1hq/notas/tickets/kssh.md
/home/blaggacao/ghq/keybase/team/p1hq/notas/tickets/goautodial.md
/home/blaggacao/ghq/keybase/team/p1hq/notas/tickets/wireguard.md
notes ls | xargs rg feedback
/home/blaggacao/ghq/keybase/team/p1hq/notas/minutas/Feedback: No such file or directory (os error 2)
EPs: No such file or directory (os error 2)
&: No such file or directory (os error 2)
Todos.md: No such file or directory (os error 2)
blaggacao commented 4 years ago

For a fix, in my opinion, I'd would be visually preferable if only the spaced part would get quoted, like so, in order to not disturb the column alignments of the folder parts:

/.../notas/minutas/"Feedback EPs & Todos.md"