Commit Graph

3733 Commits (bf4ddf59513e5cb151a18776bd4575c50e1b8be6)

Author SHA1 Message Date
John D Pell bdfb987f0c plugin/xterm: don't rely on `$1`
_bash-preexec_ passes the "current" command line as `$1`, but this is unreliable and we explicitly discourage it's use.

Use `$BASH_COMMAND` instead.
2021-10-20 15:50:15 -04:00
John D Pell 9ce199c251 preexec: set options before load
By setting `__bp_delay_install`, we avoid any immediate initialization at all. We then override two troublesome functions before calling `__bp_install_after_session_init()`.

The `__bp_install_after_session_init()` function doesn't enable the DEBUG trap, just sets `$PROMPT_COMMAND` to include `__bp_install()`, so the actual final `$PROMPT_COMMAND` is not finished, and DEBUG trap set, until after the first prompt is displayed.
2021-10-20 15:28:59 -04:00
John D Pell 00f5f2a62e Use `_bash-it-egrep()` 2021-10-18 22:08:56 -04:00
Noah Gorny 2d1bd82575
Merge pull request #1975 from krapshsa/krapshsa-patch-1
Fix save-and-reload-history command not found
2021-10-18 22:22:21 +03:00
Noah Gorny 5e3810ac96
Merge pull request #1973 from gaelicWizard/utilities
lib/utilities: minor improvements
2021-10-18 22:05:05 +03:00
Noah Gorny 5feebcc9d9
Merge pull request #1974 from zou000/patch-1
Fix home dir substitution
2021-10-18 21:59:59 +03:00
krapshsa b0e8729b0f
Fix save-and-reload-history command not found 2021-10-19 00:58:01 +08:00
John D Pell 253d1213e0 lib/utilities: new function `_bash-it-egrep()`
The existing function `_bash-it-grep()` is weird. New function `_bash-it-egrep()` just does the thing without requiring two subshells and manual invocation.
2021-10-18 09:14:32 -04:00
John D Pell b8ee63c67d lib/utilities: quote SC2295
Doesn't show up on my shellcheck 0.7.2, but does for NoahGorny!
2021-10-18 09:14:32 -04:00
John D Pell b986c39040 lib/utilities: XDG_CACHE_HOME
Use $XDG_CACHE_HOME environment constant instead of placing a tmp/cache folder inside the bash-it data repo. If not defined, fall back to current behavior.

This resolves Bash-It/Bash-It#1904.
2021-10-18 09:14:32 -04:00
Noah Gorny 7987e4bfcd
Merge pull request #1883 from seefood/ira/autosave-history-plml
Add history flushes on each command to the powerline themes
2021-10-17 19:51:56 +03:00
zou000 7911f770cf
use `\w` 2021-10-16 22:29:25 -07:00
zou000 bb3a51f742
Update powerline.base.bash 2021-10-16 20:24:07 -07:00
zou000 413d7a1326
Fix home dir substitution
See the discussions in 953e422bed (commitcomment-58148656) . Tested with bash 5.1 and  bash 3.2
2021-10-16 19:15:00 -07:00
John D Pell 7cd02781f8 lib/utilities: `_bash-it-component-help()`
No need to `rm` when we overwrite the file the line after next. Alsö, use `>|` in case the user sets `noclobber`; we do expressly intend to overwrite the file in this case.
2021-10-13 21:13:45 -07:00
John D Pell f7cc442af4 lib/utilities: simplify `_bash-it-array-dedup()`
alsö fix usage example of `_bash-it-array-contains-element()`
2021-10-13 09:28:21 -07:00
Noah Gorny 48c17e95c3
Merge pull request #1968 from gaelicWizard/oops
theme/powerline: fix an oops in the last patch
2021-10-12 23:26:17 +03:00
John D Pell 953e422bed theme/powerline: fix an oops in the last patch
The tilde should not have been escaped, and in fact I did not have it escaped in my main branch, but the PR I submitted did have it escaped and...now it shows up in the prompt line for all the PowerLine themes... oops.
2021-10-12 11:08:37 -07:00
Ira Abramov d6239cf190 Merge branch 'master' of https://github.com/bash-it/bash-it into ira/autosave-history-plml
* 'master' of https://github.com/bash-it/bash-it: (114 commits)
  ci: Bump go to 1.17 from 1.14
  skip go tests when go is not available
  plugins: Add ble.sh plugin
  clean up pyenv plugin
  Lint: prepare `lib/utilities` for `shellcheck` (#1933)
  plugin/base: improvements (#1930)
  plugins/percol: `bind`
  completion/git: `shfmt` && `shellcheck`
  completion/git: expand search range
  plugin/percol: `shellcheck` & `shfmt`
  plugins/percol: use `_command_exists`
  completion/pip: simplify code flow
  plugin/less-pretty-cat: remove `|| cat`
  completion/wpscan: simplify code flow (whitespace)
  plugins/less-pretty-cat: simplify code flow
  plugins/less-pretty-cat: use `_command_exists`
  lib/helpers: cite `_bash-it-find-in-ancestor()`
  gradle: adopt `_bash_it_find_in_ancestor()`
  lib/helpers: new function `_bash-it-find-in-ancestor()`
  completion/laravel: simplify code flow
  ...
2021-10-11 08:32:15 +03:00
Noah Gorny 49698e269a
Merge pull request #1971 from NoahGorny/ci-update-go-version
ci: Bump go to 1.17 from 1.14
2021-10-10 23:58:08 +03:00
Noah Gorny adab880f89 ci: Bump go to 1.17 from 1.14 2021-10-10 23:50:39 +03:00
Ira Abramov c3d333ddc4 fix based on remarks on PR 2021-10-10 15:25:45 +03:00
Noah Gorny cf08fcaff2
Merge pull request #1965 from gaelicWizard/completion-git
completion/git: improvements and linting
2021-10-07 00:10:47 +03:00
Noah Gorny c3382c7b50
Merge pull request #1884 from NoahGorny/add-blesh-plugin
plugins: Add ble.sh plugin
2021-10-06 22:49:15 +03:00
cornfeedhobo 07384bcf7c
Merge pull request #1967 from cornfeedhobo/goenv-go-tests
skip go tests when go is not available
2021-09-30 07:34:05 -05:00
cornfeedhobo b7feb14404
skip go tests when go is not available 2021-09-29 18:16:52 -05:00
Noah Gorny cd38f32d95 test: Fix completion tests and add profile completion ones 2021-09-29 00:30:24 +03:00
Noah Gorny 4c4b138671 tests: Add more bash-it profile tests 2021-09-29 00:30:24 +03:00
Noah Gorny 7fc003b7d6 completion: Add completion for bash-it profile rm/list 2021-09-29 00:30:24 +03:00
Noah Gorny e1017513d0 helpers: Disallow removing the default profile with bash-it profile rm 2021-09-29 00:30:24 +03:00
Noah Gorny 1ae407150c helpers: Improve bash-it profile messages 2021-09-29 00:30:24 +03:00
Noah Gorny 337e188d25 helpers: Add bash-it profile rm 2021-09-29 00:30:24 +03:00
Noah Gorny 81b17f795b helpers: Add bash-it profile list 2021-09-29 00:30:24 +03:00
Noah Gorny 6a923760d8 helpers: Add help message for bash-it profile 2021-09-29 00:30:24 +03:00
Noah Gorny c710fc783a gitignore: Ignore new profiles 2021-09-29 00:30:24 +03:00
Noah Gorny b2ee5f96a5 test: helpers: Add profile command tests 2021-09-29 00:30:24 +03:00
Noah Gorny d4ec41bef7 helpers: Add useful log in case of empty config 2021-09-29 00:30:24 +03:00
Noah Gorny df560ca04a docs: Add profile command docs 2021-09-29 00:30:24 +03:00
Noah Gorny f78139fc05 install: Use new profile load command 2021-09-29 00:30:24 +03:00
Noah Gorny 2e3fe0a1ea install: Load log file 2021-09-29 00:30:24 +03:00
Noah Gorny cea95d72b3 lib: helpers: Rename _bash-it-process-component to _bash-it-determine-component-status-from-path 2021-09-29 00:30:23 +03:00
Noah Gorny 7f60b73a2a helpers: Add new bash-it profile subcommand 2021-09-29 00:30:23 +03:00
Noah Gorny 956ca517f4 profiles: Add new default profile 2021-09-29 00:30:23 +03:00
Noah Gorny eaa2f829bd completion: Add bash-it profile subcommand 2021-09-29 00:30:23 +03:00
Noah Gorny 41cba9d7e4 helpers: Add enable-plugin and enable-alias aliases 2021-09-29 00:30:23 +03:00
Noah Gorny ffeb770593 helpers: Print type when using disable all 2021-09-29 00:30:23 +03:00
Noah Gorny 6e03a726a6 helpers: Split some processing code out of _bash-it-describe 2021-09-29 00:30:23 +03:00
Noah Gorny 7fb7bb9cb8
Merge pull request #1952 from gaelicWizard/uncle
lib/helpers: new function `_bash-it-find-in-ancestor()`
2021-09-28 16:51:30 +03:00
Noah Gorny 008c2b30ac
Merge pull request #1885 from cornfeedhobo/pyenv-path
clean up pyenv plugin
2021-09-28 16:49:21 +03:00
Noah Gorny c360f0c7c5 plugins: Add ble.sh plugin 2021-09-28 16:48:16 +03:00