AnthonyDiGirolamo / todotxt-machine

an interactive terminal based todo.txt file editor with an interface similar to mutt
https://pypi.python.org/pypi/todotxt-machine/
GNU General Public License v3.0
244 stars 37 forks source link

todo.txt file saved with no newline at end of file #20

Closed kmac closed 9 years ago

kmac commented 9 years ago

I've run into an issue when I use todotxtmachine along with todo.sh.

When I open todotxt-machine, then exit with 'q', the todo.txt file is saved with no final newline at the end of the file. This is causing an issue when I then use todo.sh to add a new entry. The result of something like todo.sh add "new entry" is that the "new entry" gets appended to the last line in todo.txt, rather than saved on a new line as expected.

A diff of the before/after todo.txt file after running todotxt-machine shows something like this:

cp todo.txt todo.txt.orig
todotxt-machine
<exit with 'q'>
diff todo.txt todo.txt.orig
32c32
< 2015-02-10 some work item
\ No newline at end of file

---
> 2015-02-10 some work item

Diff showing todo.txt after the todo.sh add -t "new entry":

diff todo.txt todo.txt.beforemachine
32c32
< 2015-02-10 some work item2015-02-10 new entry

---
> 2015-02-10 some work item

Version:

todotxt-machine --version
2.0.5
AnthonyDiGirolamo commented 9 years ago

Merged pull request #21