Commit Graph

311 Commits (8eb90f7ac1ccdcdd77b28df3d09a3dca063b0135)

Author SHA1 Message Date
OMEGA_RAZER af11a50854
Allow for longer command min duration (#2198)
Allows for setting "COMMAND_DURATION_MIN_SECONDS" to more than 60 seconds without adding to prompt. Previously always showed with lengths over 60 seconds regardless of setting.
2023-02-22 08:24:30 -08:00
David Farrell 7c7e4f90ec
bug: Use en_US when fetching EPOCHREALTIME
Isolates fetching of EPOCHREALTIME to a function which sets LC_ALL=en_US.UTF-8.
This ensures that the value is in decimal format, regardless of runtime locale.

bug: Hide duration when no command executed
2022-10-30 15:18:09 -07:00
David Farrell 00062bfcb6
chore: Use grep -E / grep -F instead of egrep / fgrep (#2164)
Ensures that the -E or -F option, when used, is the first option
* i.e. grep -oE => grep -E -o

Updates _bash-it-grep to invoke grep with just the provided arguments
* This function was (and still is) unused, but decided this new functionality was actually more useful

Introduces _bash-it-fgrep to invoke grep -F

Removes type -P egrep from the _bash-it-*grep functions

For usages that were already going to be modified, use -F if appropriate
* Does not touch grep usages that may have benefited from -F, but were not otherwise considered for this PR

Adds shellcheck header to modified .bash files that didn't already have it
2022-10-13 10:34:57 -07:00
Gurkirat Singh 6ccd9f5adf
fix (helpers): bashit_update function return to source path and --no-merges in log 2022-03-21 08:52:46 +05:30
Noah Gorny d1b831a92d
Merge pull request #2119 from BarbUk/fix/command_duration_precision
Fix/command duration precision
2022-03-14 11:59:27 +02:00
BarbUk 23efb39fb0
Fix grep path when a grep alias exists 2022-03-11 09:08:58 +01:00
BarbUk e1ddf6e311
Fix dynamic clock icon (#2120)
* Fix dynamic clock icon

* Use printf variable scope

* shfmt do not like spaces
2022-03-09 22:59:48 +02:00
BarbUk 634c1f8c18
Fix spacing in string output 2022-03-09 11:01:53 +01:00
BarbUk 4686ce1f12
Fix precision to use deciseconds instead of nanoseconds 2022-03-09 09:38:16 +01:00
Noah Gorny 13531c9534 lib: search: Increase delay in _bash-it-flash-term to 0.2 secs 2022-03-08 00:02:23 +02:00
Noah Gorny 77c135956d lib: preview: Load only bash-it.sh when previewing
Otherwise you change your theme to your default...
2022-03-08 00:01:37 +02:00
John D Pell 1c2fc2837f lib/command_duration: adopt `_bash_it_library_finalize_hook` 2022-03-04 12:58:07 -08:00
John D Pell 4e0e59230b lib/command_duration: rename `theme/command_duration.theme`
Rename the `theme/command_duration.theme` file as it's not really got anything to do with theming or SCM.
2022-03-04 12:58:07 -08:00
John D Pell 0286a50fcd lib/appearance: export `$CLICOLOR` instead of `$LSCOLOR`
Alsö, since the *value* of `$CLICOLOR` is not used anywhere, overload it to count the number of colors available for use elsewhere.
2022-03-03 23:58:55 -08:00
John D Pell f7cba27f10 lib/appearance: `shellcheck` && `shfmt` 2022-03-03 23:58:55 -08:00
Noah Gorny 34bc37c178
Merge pull request #2061 from gaelicWizard/lib/helpers
lib/helpers: fixes, improvements, consolations, constellations, and a partridge in a pear tree
2022-03-01 23:21:27 +02:00
John D Pell 47bbc73744 lib/helpers: `_bash-it-find-in-ancestor()`
Use new `composure.sh` feature to avoid `cite()`.
2022-02-24 12:47:22 -08:00
John D Pell 5957d189ea lib/utilities: `_bash-it-component-item-is-enabled()`
- Use normal `if`/`then`
2022-02-20 12:01:05 -08:00
John D Pell fe48deda2d lib: rename `_bash-it-clean-component-cache()`
…to `_bash-it-component-cache-clean()`
2022-02-20 12:01:05 -08:00
John D Pell 6257853759 lib/utilities: use `$XDG_CACHE_HOME` properly
We should fall back to the default location, not use an entirely different one.
2022-02-20 12:01:05 -08:00
John D Pell 72829ca21d lib/utilities: `_bash-it-component-item-is-enabled()`
- required arguments
2022-02-20 12:01:05 -08:00
John D Pell ffcf8f1c94 lib/utilities: >| 2022-02-20 12:01:05 -08:00
John D Pell fbd842b2ea lib/helpers: fix extraneous quotes from `_bash-it-grep()` 2022-02-20 12:01:05 -08:00
John D Pell 150f73ee50 bash-it update: show change log once 2022-02-18 03:06:17 -08:00
John D Pell 95353f1a98 lib/helpers: the last remnants of the `$OSTYPE` have been swept away
- Figure out which `sed` we have by checking, not guessing.
2022-02-17 20:46:28 -08:00
John D Pell ddf75f17ac lib/search: fix variable scope 2022-02-17 20:46:28 -08:00
John D Pell 35ecc260c2 lib/helpers: handle unbound parameters 2022-02-17 20:46:28 -08:00
John D Pell 31751624c0 lib/helpers: cleanup `_bash-it-profile-load-parse-profile()` a bit 2022-02-17 20:45:37 -08:00
John D Pell e7818dbaca lib/helpers: handle unbound positional parameters
Alsö, don't `pushd`/`popd` when restarting shell.
2022-02-17 20:45:37 -08:00
John D Pell 60c10004d1 lib/helpers: fix `_bash-it-component-pluralize()` 2022-02-17 20:45:27 -08:00
John D Pell 8246794a28 lib/preexec: the last remnants of the `$OSTYPE` have been swept away
- Use a POSIX-compliant/portable extended regular expression to match on word-boundaries, rather than guessing which regex library `bash` was linked against. See https://stackoverflow.com/a/12696899/555333 for explanation and code suggestion.
2022-02-16 16:10:41 -08:00
John D Pell c1943192ce lib/preexec: clarify subshell guard and comment
Rewrite comment on disabling the `DEBUG` trap in subshells, which is now handled upstream as of rcaloras/bash-preexec#26.

Alsö, fix the guard variable assignment to allow it to be overridden elsewhere (e.g., for testing).
2022-02-16 16:10:41 -08:00
John D Pell a93919625d lib/preexec: adobt `_bash_it_library_finalize_hook`
Schedule modification of `$PROMPT_COMMAND` for after everything has loaded.
2022-02-16 16:10:41 -08:00
John D Pell 6b08284928 Update "preexec" from "https://github.com/rcaloras/bash-preexec@master"
git-vendor-name: preexec
git-vendor-dir: vendor/github.com/rcaloras/bash-preexec
git-vendor-repository: https://github.com/rcaloras/bash-preexec
git-vendor-ref: fd2ffa8876d3940c97ffdc3cc807e43277cf72da
2022-02-16 16:10:41 -08:00
Noah Gorny 9d6fe72267
Merge pull request #2088 from gaelicWizard/lib/log
lib/log: //echo/printf
2022-02-16 22:18:22 +02:00
Puneeth Chaganti b3ef9ea209 lib/helpers: Don't rm "$profile_path" before writing to it
When the file is being re-created, we write to it, instead of appending to
it. So, the rm here is unnecessary and prevents users from linking the profile
file to another location that is potentially under version control. For
instance, once could link to a profile file located at
"$BASH_IT_CUSTOM/profiles/*.bash_it".
2022-02-16 20:55:08 +05:30
John D Pell e7b91e7be5 lib/log: use newly supported `composure.sh` feature
- these functions can now run even if `composure.sh` has *not* been loaded at all!
2022-02-15 22:20:19 -08:00
John D Pell 61b6393a4a lib/log: //echo/printf
- Replace `echo -e` with `printf` in `_bash-it-log-message()`.
- Local positional parameters to allow for defaults.
- Use `if`/`then` properly.
- Clean up use of `$BASH_IT_LOG_PREFIX` slightly (eliminate duplicate colons).
2022-02-15 22:18:24 -08:00
Noah Gorny 89c9504a5e
Merge pull request #2017 from gaelicWizard/lib/preview
lib/preview: functionalize
2022-02-13 23:59:06 +02:00
John D Pell 5d5858058e lib/history: new functions `_bash-it-history-auto-*()`
Two new functions `_bash-it-history-auto-save()` and `_bash-it-history-auto-load()`, which append new history to disk and load new history from disk, respectively.

See bash-it/bash-it#1595 for discussion.
2022-02-08 16:59:29 -08:00
John D Pell 00e3955dd3 lib/preview: add full completion 2022-02-07 15:27:03 -08:00
John D Pell a9a40a3cad lib/helpers: add `preview` to `bash-it` spaghetti 2022-02-07 15:27:03 -08:00
John D Pell d6555f369a lib/preview: refactor into a function
This allows future use like `bash-it preview`. Alsö, allows to use `$BASH_PREVIEW` to specify a particular theme to preview instead of just doing all of them.
2022-02-07 15:27:03 -08:00
Nariyasu Heseri 1e77c26c00 helpers: fix `awk: unterminated regexp` 2022-01-31 23:54:14 +09:00
Noah Gorny 2a9ee7e344
Merge pull request #2019 from gaelicWizard/lib/colors
lib/colors: split out metaprogramming
2022-01-30 00:10:14 +02:00
Noah Gorny 39e5652ee5
Merge pull request #1932 from gaelicWizard/search
Lib/search: lint, cleanup, and small fixes
2022-01-30 00:09:49 +02:00
John D Pell 4cf2aae36e lib/search: code cleanup
Improve `_bash-it-erase-term()`, `_bash-it-flash-term()`, `_bash-it-rewind()`, `_bash-it-search-result()`, and `_bash-it-search-component()`. Minor tweaks to `_bash-it-is-partial-match()`, and `_bash-it-search()`.
2022-01-28 13:35:17 -08:00
John D Pell b8694ee140 lib/search: `shfmt`
My apologies to future `git blame` hunters ♥
2022-01-28 13:35:17 -08:00
John D Pell 8939e943c5 lib/search: fix usage statement `_bash-it-search()`
SC2154
2022-01-28 13:35:17 -08:00
John D Pell 64efe52394 lib/search: fix `_bash-it-flash-term()`
1. `$text_black` isn't a parameter provided by _Bash It_. Typo?
2. `$bold_yellow` is meant for prompt strings and putputs `\[`; ditto `$bold_red`.
3. The color was never returned to normal after.
2022-01-28 13:35:17 -08:00