-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow easily getting full note paths, for compatibility with other commands #23
Comments
We could add a switch like -p rather than a whole subcommand. |
I was doing some initial research into this, The outputting short names to TTY option is good in theory, however, it breaks over SSH (since an ssh session isn't a real TTY). As an aside, it casually breaks most of our automated tests, since they don't emulate a tty proper either. While I can deal with breaking tests (They're fixable) the SSH problem is slightly more complex. I'll have to look into it a bit more to see if there's anything else to help with that problem. |
@primis Any progress? The SSH issue is interesting, and if you do manage to find a solution that solves that too, that'd be great. I think it might be ok anyway though, as long as the output is still correct and useful even if a TTY isn't available. Essentially, we could optimise for human reading if there's a TTY, and we drop the niceties if there isn't, but still come back with essentially the same information. E.g: With TTY: > notes find
work/a-note
plans When piping, or using over SSH: > notes find
/home/user/notes/work/a-note.md
/home/user/notes/plans.md It's not quite a nice or easy, but it's still perfectly workable as a fallback. We could provide an option/extra command that would override to force pretty formatting, for cases where that's important. That means the key constraint to this are:
|
Yep, on it. Busy few weeks, I'm just starting to go through and test it at the moment. |
Fixed the "SSH is seen as a pipe" error. changed very little existing code to do this too. Managed to update tests not to break by adding in a path suppressant switch (I also added a faketty function, but it's rarely needed except to actually test the suppressant) |
I dropped the PR since the code is now dated. |
Outputting nice short names (just
note.md
) is great for readability when flicking through your notes. For compatibility with other commands though (e.g.cat
: #9), you need a way to easily get the full file path (/home/tim/notes/note.md
).There's a couple of options:
notes path
command, which gives you the path to a given note (useful generally), or transforms a pipe of short note names into full note paths. E.g.notes find | notes path
to get the full paths for every note you have.Thoughts welcome!
The text was updated successfully, but these errors were encountered: