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

Tweak status item; adds cmd_duration_precise item #570

Closed
wants to merge 5 commits into from

Conversation

jetpks
Copy link

@jetpks jetpks commented Mar 15, 2025

Description

Tweaks status item
  • Adds a new configuration option tide_status_simple_failures containing status codes that should be considered "simple failures"
    • Default value added to configure/configs/*
    • Tests added
  • I plan to set this empty so all failures show a right-side indicator
  • This lets you have both the character color changing and the indicator
Adds cmd_duration_precise item
  • Almost the same as cmd_duration, but with this behavior:
    • when duration is > 1h, only show hours & minutes e.g. "1h 23m"
    • when duration is < 1h && > 1m, show minutes & seconds (no decimals) e.g. "1m 23s"
    • when duration is < 1m && > 1s, show seconds with decimals e.g. "1.23s"
    • when duration is < 1s, show milliseconds e.g. "123ms"
  • Continues to obey tide_cmd_duration_threshold and tide_cmd_duration_decimals
  • Tested

Motivation and Context

For the status item, I always want a failure indicator on the right side and I want the character to change color (I don't always notice the color change, but it's nice to have.)

For cmd_duration_precise, I have two aims:

  1. I like to see timings for all commands, but I don't want to see output like "0.427s" and would prefer "427ms"
  2. I don't need to see the smaller time units when the total duration is quite large. e.g. when a command takes 9h 47m, i don't really care if it also 23s or 53s of that 47th minute. cmd_duration_precise makes all outputs ~5-ish chars long depending on the size of the numbers while still allowing you to see large and miniscule durations.

Screenshots (if appropriate)

How Has This Been Tested

  • I have tested using Linux.
  • I have tested using MacOS.

Checklist

  • I am ready to update the wiki accordingly.
  • I have updated the tests accordingly.

jetpks added 5 commits March 14, 2025 21:33
Tweaks status item--
- Adds a new configuration option `tide_status_simple_failures` containing
  status codes that should be considered "simple failures"
  - Default added to `configure/configs/*`
  - Tests added
- I plan to set this empty so all failures show a right-side indicator
- This lets you have both the character color changing and the indicator

Adds new cmd_duration_precise item --
- Almost the same as cmd_duration, but with this behavior:
  - when duration is > 1h, only show hours & minutes e.g. "1h 23m"
  - when duration is < 1h && > 1m, show minutes & seconds (no decimals) e.g. "1m 23s"
  - when duration is < 1m && > 1s, show seconds with decimals e.g. "1.23s"
  - when duration is < 1s, show milliseconds e.g. "123ms"
- My motivation is reducing the output to just "what I need to know,"
  trimming the precision to just what's valuable
- Continues to obey tide_cmd_duration_threshold and tide_cmd_duration_decimals
- Tested
@jetpks
Copy link
Author

jetpks commented Mar 15, 2025

will reopen when ready; originally meant to open this against my fork lol

@jetpks jetpks closed this Mar 15, 2025
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.

None yet

1 participant