josephhaaga / clerk

Simple CLI to manage daily journals
1 stars 0 forks source link

abandoned tmux sessions result in "File already open!" #34

Open josephhaaga opened 1 year ago

josephhaaga commented 1 year ago

Yesterday I probably quit Terminal + tmux while a journal was still open. Today I tried to review that journal

$ tmux
$ journal yesterday
File already open!

$ ls ~/Library/Application\ Support/clerk
0.0.5         2022-12-19.md 2022-12-20.md 2022-12-21.md
  1. Add the tmpdir path to the error message. I had to hunt down the ~/Library/Application\ Support/clerk path (fortunately I had another journal open, and vim showed me the current dir)
  2. determine a more-foolproof way to clean up old journals (read up on Vim's swp file design, the pros/cons etc.)
josephhaaga commented 1 year ago

we should at least tell users

If this is an issue, please rm -rf {path_to_leftover_file}

otherwise I need to search the clerk source code, and then google appdirs