Skip to content
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

New tasks being added to old lines #340

Open
AdamBD opened this issue Apr 30, 2021 · 3 comments
Open

New tasks being added to old lines #340

AdamBD opened this issue Apr 30, 2021 · 3 comments

Comments

@AdamBD
Copy link

AdamBD commented Apr 30, 2021

Do you want to request a feature or report a bug?
Bug

What is the current behavior?
Sometimes when adding tasks they are not added as new lines in the file but appended to some previous line

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.

What is the expected behavior?
Each addition will be added to a new line in the file

Which versions todo.sh are you using?
TODO.TXT Command Line Interface v2.12.0

Which Operating System are you using?
MacOS BigSur 11.2.1

Which version of bash are you using?
zsh 5.8 (x86_64-apple-darwin20.0)

@AdamBD AdamBD changed the title New tasks being added to old linkes New tasks being added to old lines Apr 30, 2021
@inkarkat
Copy link
Member

The core todo.sh has tests that ensure that this does not happen. It could be a misbehaving add-on that you're using, or are you "sometimes" editing the file in another editor? Some editors omit a final newline in the last line (especially on Windows), or this could also be caused by mismatching line endings (a.k.a. CR-LF vs. LF).

@AdamBD
Copy link
Author

AdamBD commented May 1, 2021

@inkarkat thanks for replying! I am indeed using another client in addition. I am using a mac client called sleek (https://github.com/ransome1/sleek), but the behavior I see can happen when just using this CLI. Any advice on ways to enforce the same line behavior?

@inkarkat
Copy link
Member

inkarkat commented May 1, 2021

Some clients have a setting (like Windows-friendly line breaks in Simpletask) to influence the behavior. But it would seem that such a mismatch would result in very reproducible corruption (e.g. whenever I add a task in the other client, todo.sh will then append to that if I use it next).

So maybe you could closely monitor when such corruption occurs for some time, and try to find a way to reproducibly cause corruption. As I said, just by using todo.sh itself (i.e. without synchronization of the todo.txt file and maybe another client running concurrently), I doubt that such problems can occur, and it's far more likely to be caused by something in the environment. Nonetheless, if you can find a reproducible example, we'll surely look into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants