Skip to content

Conversation

@russelltadams
Copy link
Contributor

@russelltadams russelltadams commented Dec 15, 2020

This commit is intended to help new users of the
modern-t theme get it set up properly
and avoid the "todo.plugin" breaking it

Please see the following issues for details.
#1693
#1374

russelltadams and others added 2 commits December 15, 2020 11:09
This commit is intended to help new uses of the
modern-t theme get it set up properly
and avoid the "todo.plugin" breaking it

Please see the following issues for details.
Bash-it#1693
Bash-it#1374
# for "t", the minimalist python todo list utility by Steve Losh.
# Get and install "t" at https://github.com/sjl/t#installing-t
#
# Warning: The Bash-it plugin "todo.plugin" breaks the "t"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I prefer to fix the plugin and not add a warning here. I will try to fix it up in the upcoming days

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. I think "t" is pretty well unknown, and unless I missed it, I see no readme for the "modern" themes. That would be a better place for this info to be. Would a readme doc for the modern themes be appreciated? I have come this far, I'd like to try to get a PR in if I can. I would think it should be here "bash-it/docs/themes-list/". I also noticed the screenshots for "modern-t" also show that "t" is not installed, as there is an error. This is kind of what I mean, most that might try modern-t have no idea that there is an actual dependence called "t", or even if they figure it out, it's not easy to find, sadly as it is a very good little utility.

Also, It would be easy to create a "todo.sh" variant, "modern-todo" with the same CLI integration functionality as "modern-t". I'd be happy to submit that one, but I am unsure how people feel about having multiple varients of the same theme.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think adding a readme doc will be a great idea of you can do it- the location you assumed is the correct one as well!
I do not think we need another theme for that, but we might need to improve (and add) docs about "modern-t" and also maybe add a check that it indeed uses the "t" utility

@russelltadams
Copy link
Contributor Author

russelltadams commented Dec 18, 2020

Well, I am not sure what is wrong with the plugin in a technical sense. It seems there is just a collision between the plugins alias to "t" and that breaking the undocumented use of "t" the script in "modern-t". Now that I know this, I don't see any problem other than lack of documentation.

If you know all these things, all it takes to get a working "modern-t" cli that work with todo.sh is to add awk '{print ($1-2)}' as the difference between "t" list output, its default action, and what todo.sh ls gives, is just 2 lines in the latter you don't need to "count".

Might be the theme could handle both properly by adding more "if then" statements to decide which function to use in the prompt based on what is available, but honestly better documentation for the theme and just putting these in a VAR with one commented out would be enough. OR... a whole new theme?

$(tls | wc -l | awk '{print ($1-2)}' | sed -e's/ *//') for "todo.sh" assuming aliases and plugin are enabled.
OR
$(t | wc -l | sed -e's/ *//') for "t".

@NoahGorny
Copy link
Member

Well, I am not sure what is wrong with the plugin in a technical sense. It seems there is just a collision between the plugins alias to "t" and that breaking the undocumented use of "t" the script in "modern-t". Now that I know this, I don't see any problem other than lack of documentation.

If you know all these things, all it takes to get a working "modern-t" cli that work with todo.sh is to add awk '{print ($1-2)}' as the difference between "t" list output, its default action, and what todo.sh ls gives, is just 2 lines in the latter you don't need to "count".

Might be the theme could handle both properly by adding more "if then" statements to decide which function to use in the prompt based on what is available, but honestly better documentation for the theme and just putting these in a VAR with one commented out would be enough. OR... a whole new theme?

$(tls | wc -l | awk '{print ($1-2)}' | sed -e's/ *//') for "todo.sh" assuming aliases and plugin are enabled.
OR
$(t | wc -l | sed -e's/ *//') for "t".

The plugin should not really create an alias like that, but in any case you are correct that the theme can check and behave differently if i.e t is an alias to something else. I will welcome PRs that improve the theme 😄

@NoahGorny
Copy link
Member

@russelltadams Thanks for this PR! I will merge this, but much more work is needed!
We will welcome new contributions 😄

@NoahGorny NoahGorny merged commit b119540 into Bash-it:master Dec 27, 2020
seefood added a commit to seefood/bash-it that referenced this pull request Oct 7, 2025
Renames `aliases/available/todo.txt-cli.aliases.bash` to
`aliases/available/todo.aliases.bash` to match the naming convention
expected by the interactive install script.

**Problem:**
The install script in `_bash-it-install-enable()` (install.sh:26) parses
alias filenames using the pattern:
```bash
just_the_name="${file_name%".${file_type}.bash"}"
```

This expects: `{name}.aliases.bash` → extracts `{name}`

But the file was named `todo.txt-cli.aliases.bash`, which when stripped
of `.aliases.bash` leaves `todo.txt-cli`, causing the install script
to fail to recognize it during interactive installation.

**Solution:**
Rename to `todo.aliases.bash` to match the convention used by:
- `todo.plugin.bash` ✅
- `todo.completion.bash` ✅

Now extracts correctly: `todo.aliases.bash` → `todo`

**Notes:**
- File content unchanged - already uses `$TODO` variable correctly
- These are thin wrappers for the external todo.txt-cli tool
- Users install todo.txt-cli separately: `brew install todo-txt`
- Official upstream: https://github.com/todotxt/todo.txt-cli

**Related Issues:**
- Fixes Bash-it#2314 (interactive install failure)
- Related to Bash-it#1693, Bash-it#1742, Bash-it#2005 (todo plugin cleanup history)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
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

Successfully merging this pull request may close these issues.

2 participants