howm icon indicating copy to clipboard operation
howm copied to clipboard

Colon in file path confuses grep-based search

Open kaorahi opened this issue 10 months ago • 3 comments

For example, a file named foo:bar does not appear in the search results when grep is used as the backend.

Howm runs the following command internally and parses its output (howm-grep-parse-line). A colon in the filename obviously confuses parsing here.

echo 'foobar' | \grep -F -i -Hnr -f - ~/BAZ/QUX

I don't believe there's a perfect solution for the default grep command. If you really can't stand it, probably the only way would be to use a non-standard version of grep that supports JSON or something similar. Personally, I don't think it's worth worrying about that much, at the cost of losing its out-of-the-box usability.

Is "won't fix" reasonable?

kaorahi avatar Mar 02 '25 11:03 kaorahi

I think the main two cases where this might cause an issue are:

  • Windows users who probably have paths start with C:\ or similar. But here, I believe grep is not used by default? Do we need a warning for Windows users about this? Or is it not relevant if the results use relative not absolute paths?
  • Unix users who change the Howm file format to have HH:MM:SS time formats in their notes, e.g. 2025-05-30 14:07:30.md. Should there be a warning if users customize howm-file-name-format to contain colons to prevent confusion?

But I think "won't fix" is reasonable, but perhaps adding warnings might be useful.

jabirali avatar May 30 '25 12:05 jabirali

Thanks for the suggestions. For the former, drive letters are already accounted for in the variable howm-grep-parse-regexp. For the latter, I will consider adding a warning.

kaorahi avatar May 31 '25 08:05 kaorahi

Sorry for the delay. Since this doesn't seem urgent, I'll implement it when I can.

kaorahi avatar Jun 19 '25 22:06 kaorahi