Commit Graph

162 Commits (a7955b972c2f45e044de925629fb02d89e11593b)

Author SHA1 Message Date
Ethan Edwards db55c63c77 GH-1142 add behavior to address using set -e 2018-02-06 11:08:44 -06:00
Ethan Edwards 3eb5e037f9 GH-1140 add safe usage of SCM variable 2018-02-06 03:32:08 -06:00
Nils Winkler fe1ae061cc
Merge pull request #1018 from wendorf/git-helpers
Allow non-alphanumeric git branch names
2017-12-19 09:19:38 +01:00
Dan Wendorf c5f2c408e7 SCM_CURRENT_USER supports accented characters
`tr 'A-Z' 'a-z'` will only convert non-accented characters. Switching to
`[:upper:]` and `[:lower:]` adds support for accents.
See https://github.com/koalaman/shellcheck/wiki/SC2018

Additionally, printf's character splitting does not support accented
characters, so output isn't as expected. Using bash's variable expansion
syntax instead will correctly get the full accented character.
2017-12-18 09:05:33 -08:00
Dan Wendorf 150e82b221 Refactor git functionality into githelpers.theme.bash
- Add unit tests around git functionality
2017-12-18 09:05:33 -08:00
Nils Winkler 0267554c22 Fixed issue introduced in #1109
With the added $ in there, it would show an error in Git repos:

-bash: ##: command not found
2017-12-11 11:35:52 +01:00
Robin Richtsfeld c86038d61d Fix some Bash issues 2017-12-09 15:06:22 +01:00
Nils Winkler 68409f3566
Revert "Update base.theme.bash with RUBY interpreter version check" 2017-11-28 08:25:25 +01:00
Luis Felipe Sánchez 31a0c6a9fd
Update base.theme.bash
Added feature to detect the ruby version interpreter
```bash
       rb_interp_prompt
```
and added to the existing function to be used in any theme.
2017-11-22 10:14:38 -05:00
Telmo Costa 1fd3fa2440 Allow theming git stash chars 2017-11-12 17:42:11 +00:00
Wei-Han Chen 5ff7df1607 support bash-preexec 2017-11-07 02:59:25 +08:00
Nils Winkler 145ec5dfaa Copied command_exists function to the helpers lib so that there is no hidden dependency on the base plugin
The original command_exists function will stay in the base plugin, but will no longer be used by other plugins or themes.
2017-09-17 21:05:59 +02:00
Nils Winkler c33861a9b0 Change dependency check for battery_char function 2017-06-24 17:31:31 +02:00
Nils Winkler 3fac1c7ea5 Fix checks for battery plugin
These now check for the presence of the required function instead of
checking for the battery file in the enabled directory.
2017-06-24 17:31:31 +02:00
林博仁 e2d3419639 Fix more space-in-path-proof issues
Signed-off-by: 林博仁 <Buo.Ren.Lin@gmail.com>
2017-05-02 11:11:13 +08:00
Ivan Font 0ce7b8f4e0 Add function for user@host in prompt 2017-04-23 18:02:27 -07:00
DenMat 01e5cee40c make this consistent like other declarations 2017-04-19 19:03:40 +10:00
DenMat a5c693b6bc Addresses vulnerability describe here https://github.com/Bash-it/bash-it/issues/920
* white lists acceptable characters and replaces dangerous characters with '-'
2017-04-19 18:45:50 +10:00
Nils Winkler 889ce4a9f3 Merge pull request #886 from font/scm_prompt_char_info
Add AIO function to echo scm prompt char and info
2017-02-12 10:15:58 +01:00
Ivan Font 31e3d78ae4 Fix exact match regular expression for macOS 2017-01-29 22:38:58 -08:00
Ivan Font 1f0108193d Fix for issue #883 2017-01-17 21:21:19 -08:00
Ivan Font 48d4ad274a Add prefix and suffix capability to SCM char 2017-01-16 23:20:31 -08:00
Ivan Font 9e4f1d6d80 Refactor common code into scm_prompt_info_common 2017-01-16 22:14:15 -08:00
Ivan Font f9b1dcee26 Add AIO function to echo scm prompt char and info
Invoking the scm_char and scm_prompt_info functions separately for PS1
duplicates calls to the scm and scm_prompt_char functions to check what
${SCM}, if any, we currently reside in. This problem was exacerbated
when working outside of any repo as we had to go through all the
conditionals just to determine we're not in any scm repo. Unnecessary
conditionals slows down the prompt so this adds a new function that
streamlines printing out both the scm char and scm prompt info with one
invocation.
2017-01-16 22:14:15 -08:00
Ivan Font a70b769817 Remove references to GIT_THEME_* variables 2017-01-04 17:43:56 -08:00
Ivan Font 1d55249181 Refactor functions and update documentation
Add new variable to enable/disable git prompt minimal status information
and consolidate functions for code re-use. Also update README
documentation to capture the usage of new variable.
2017-01-04 15:48:32 -08:00
Ivan Font a068e3b66e Add option for basic git status prompt
Fixes #873
2016-12-31 12:43:23 -08:00
Ivan Font 771082cdc2 Add prefix/suffix for clock prompt and clock char 2016-12-05 09:04:29 -08:00
MunifTanjim 8c9777df43 revert pull 797 2016-10-21 21:03:51 +06:00
MunifTanjim a2a6fa2812 refactor themes to support standardized clock functions 2016-10-18 20:58:07 +06:00
MunifTanjim 8dde691671 standardize clock functions 2016-10-18 20:31:07 +06:00
MunifTanjim 08fba38c43 fix backward compatibility 2016-10-17 16:10:44 +06:00
MunifTanjim 7d901b11b6 seperate clock_char function 2016-10-17 04:11:09 +06:00
MunifTanjim 01dab32683 modify clock prompt for better customizability 2016-10-17 03:37:25 +06:00
MunifTanjim 4468c1b126 improve scm_prompt_info 2016-10-08 12:44:34 +06:00
Sam Gunaratne 1a4c03b08c Fixes issue with PROMPT_COMMAND ending in semi-colon 2016-08-03 10:04:24 +01:00
Yuhao Wu af96da5d11 Fix bug: themes break global $PROMPT_COMMAND variable
Safely append functions to $PROMPT_COMMAND instead of setting it.
2016-07-07 17:13:00 +09:00
Robert Rauch 669d068b12 Support HG_ROOT containing whitespaces 2016-06-02 10:36:37 +02:00
Konstantin Gredeskoul 36d994dec5 Explained `git pair` and a more reliable fallback
- Added more information to the README about the practice of using `git
  pair`, and provided instructions on installing the support.

- Write a more reliable fallback that uses `user.name` to extract user
  initials, when `user.initials` aren't set.
2016-03-16 20:15:20 -07:00
Konstantin Gredeskoul b70018e531 Adding support for git user & git pair 2016-03-14 03:42:38 -07:00
Robert Rauch ba5e7c9268 Speed up $PROMPT_COMMAND by using rvm-prompt
Running `rvm tools identifier` seems to be really slow. Using [`rvm-prompt`](https://rvm.io/workflow/prompt) greatly speeds up the evaluation of `$PROMPT_COMMAND`.
2016-02-06 21:19:30 +01:00
Eduardo Bellido Bellido c290aa9638 Fix an error when showing the status of a git repo 2016-02-03 22:58:19 +01:00
Christophe Aguettaz a2ac5b0096 Fixed compatibility with older bash versions.
Older versions (like 3.2, current default on MacOS X) don't implement
readarray.
2016-01-26 20:05:47 +01:00
Christophe Aguettaz 3fa0881281 [bugfix] Fixed performance issue with git prompt
The git prompt would could bash to use 100% CPU
for large amounts of time when dealing with long
`git status` outputs.
2016-01-25 20:02:50 +01:00
Bill Moritz b967674e6c Add support for AWS Tools Profile.
http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html
2015-12-05 11:52:58 -05:00
Eduardo Bellido Bellido 86b9af62c3 Fix grep pattern 2015-09-10 20:07:04 +02:00
Eduardo Bellido Bellido d0565e8954 Add a flag (SCM_GIT_IGNORE_UNTRACKED) to ignore untracked files in git prompt 2015-09-06 20:02:20 +02:00
Eduardo Bellido Bellido 0943aec34b Improvements in git prompt
- Git prompt now indicates when remote tracked branch is "gone"
- New env var (SCM_GIT_DETACHED) that indicates when HEAD is detached
- New env vars available for themes (SCM_THEME_BRANCH_TRACK_PREFIX,
  SCM_THEME_BRANCH_GONE_PREFIX, SCM_GIT_DETACHED_CHAR)
- Refactor of git_prompt_vars function from base theme
2015-09-06 00:59:27 +02:00
Eduardo Bellido Bellido 78cb41a1cf Add the option to show git branch remote tracking info in git prompt 2015-09-05 15:04:25 +02:00
Eduardo Bellido Bellido 86fd5cd5c4 Improve ref detection in git prompt 2015-09-05 02:12:38 +02:00
goromlagche f7877a1ef8 prefixing THEME to BATTERY_CHECK and CLOCK_CHECK 2015-08-27 19:00:18 +05:30
goromlagche e525ea1fbe clock_check added, datetime added instaed of clock, also battery_percentage added 2015-08-12 22:59:18 +05:30
goromlagche 39b5d0b042 adding time to bobby 2015-08-12 00:20:50 +05:30
Aakash Shah 0e456639d7 Update base.theme.bash
Fix support for recognizing git when in submodules and the regression when in subdirectories of a git repository.
2015-07-23 13:58:55 -07:00
Dan Wendorf c711b1b575 Show git prompt when in a detached HEAD state
The current check of `git symbolic-ref HEAD` does not detect git
repositories in the 'detached HEAD' state. This is the state a
repository is in if HEAD is not pointing to a valid branch or tag (e.g.
you are in a recently-initiated submodule).
2015-07-16 18:06:48 -07:00
Ian Huston 80c7874ebc Add Python version and Conda environment prompt functions. 2015-06-06 10:44:56 +01:00
Eduardo Bellido Bellido 418e6fae14 Changed default value to true for SCM_GIT_SHOW_DETAILS 2015-01-06 12:57:57 +01:00
Eduardo Bellido Bellido 4b97037af4 Moved some features from Powerline theme to base theme 2014-12-31 19:44:10 +01:00
Eduardo Bellido Bellido 2830020c5d Added an option to show (defaults true) the details in git repos 2014-12-29 21:54:46 +01:00
Eduardo Bellido Bellido 54921d9294 Now git_prompt_vars indicates when HEAD not points to a branch 2014-12-29 02:26:09 +01:00
Eduardo Bellido Bellido 0227691ca9 More info about Git repository added
Now, staged, unstaged and untracked files count can be shown in themes
2014-12-24 00:36:01 +01:00
Kovica 35adbaf7b3 On new repositories ./hg/branch and .hg/dirstate do not exist. In this case use "hg summary" 2014-12-12 20:32:04 +01:00
Kovica 324e1edfce Don't need that echo 2014-12-12 15:51:12 +01:00
Kovica 6f126b80e4 Added comments 2014-12-12 15:19:28 +01:00
Kovica 8914d452d8 We don't need return values 2014-12-12 15:08:07 +01:00
kovica 9a134acd06 Update base.theme.bash
Faster Mercurial status
2014-12-12 11:54:00 +01:00
Ben Brunton d7912f8f1b prevent battery_charge call from erroring in themes when battery plugin not enabled 2014-11-12 17:27:38 +00:00
Travis Swicegood 43eb4950b1 Merge pull request #345 from carlos-reynosa/scm-status-check-flag
Version Control Environment & Status Check Flag
2014-11-03 16:00:48 -08:00
Eric Baer b517629303 Don't return rbenv or rvm if the don't exist 2014-10-28 18:08:01 -07:00
Carlos E. Reynosa-Nunez 34e9525f1a Added a flag within the base theme to turn version control checks completely off or on. 2014-10-04 17:13:23 -07:00
Eduardo Bellido Bellido c6bb8507ad Fix regression checking git repo status 2014-08-26 00:23:27 +02:00
Eduardo Bellido Bellido f9448f5ebb Fix regression in git prompt 2014-08-13 22:47:34 +02:00
Eduardo Bellido Bellido ee698fbae3 Added support to git old versions 2014-08-01 00:49:57 +02:00
hequn 4eea1555aa Add git config option bash-it.hide-status to decide whether check git status. 2014-04-02 18:41:28 +08:00
Travis Swicegood 51416056b2 Add ability for themes to specify that you're viewing a tag along with Powerline implementation 2014-04-01 10:41:00 -05:00
Steven Koeberich 769e1d57a9 added support for git tags 2014-03-17 17:29:12 +01:00
Christophe Aguettaz c06ecc53cb Git-related fixes for themes.
Improved prompt display speed when git is not installed by
preventing bash from walking the path before each prompt.

Removed pesky stash-related git error message when in bare repos.
2014-03-15 11:38:25 +01:00
Christophe Aguettaz 714f0e6099 Improved prompt speed when hg is not installed.
Prevented bash from walking the path looking for hg when it is not
installed during each prompt refresh.
2014-03-14 16:32:19 +01:00
Travis Swicegood 0986e40d6c Merge pull request #263 from aramprice/master
Update chruby prompt to show "(system)" when using system ruby
2014-02-05 15:57:34 -06:00
aram price 306f7b1587 Update chruby prompt to show "(system)" when using system ruby 2014-02-04 12:06:02 -08:00
Marshall Yount 231d7fcd48 fix bug where "no active gemsets" displayed to STDERR 2014-01-16 12:04:47 -06:00
Marshall Yount 2bc89fd8c1 add support for rbenv gemset command to bash prompt 2014-01-09 12:37:06 -06:00
Travis Swicegood 24c1cd1170 Trim the whitespace from git stash output 2013-11-25 17:07:14 -06:00
Eduardo Bellido Bellido 38575181da Added support to show commits ahead, commits behind and stashes count in Git
through variables
2013-11-12 23:54:07 +01:00
aram price b48a0f2f65 Add chruby and chruby-auto plugins
* chruby.bash loads chruby
  * chruby-auto.bash loads chruby and enables auto-switching
  * add chruby_version_prompt() function for displaying ruby version
  * inspired by https://gist.github.com/rssvihla/6153455
2013-11-03 18:08:03 -08:00
Conrado Buhrer 70e4ac9e55 fixed: hg branch grep+awk problem #197 2013-04-10 13:57:21 -03:00
manojlds f93feb6e01 Using $VIRTUAL_ENV to set virtualenv prompt 2013-02-14 10:38:12 +05:30
xiaogaozi cd7eaaa066 Change the test expression of Git 2012-05-04 22:51:48 +08:00
Daniel Leavitt 5659a73445 Show rbenv active ruby rather than system ruby 2012-04-24 23:08:40 -07:00
Eitan Adler 3fc60b5358 Fix bogus bash binary location 2012-04-17 00:24:58 -04:00
Hendrik Mans 2e8be86f2b Introduce $(ruby_version_prompt), wrapping around rbfu, rbenv and RVM support. 2012-01-24 14:31:23 +01:00
Hendrik Mans d356ecb14b Add rbfu support.
Prompts can now display the currently active Ruby version set by rbfu, a tool similar to RVM and rbenv.
2012-01-24 14:30:01 +01:00
Victor Castell 76fcb58099 envy theme to implement rbenv version promt 2011-11-05 13:08:34 +01:00
John Schulz b2b629eb1f New prompt functions and variables
* `(git|svn|hg)_promp_vars` only assign values to the variables but do not `echo`
 * `(git|svn|hg)_promp_info` still `echo`s, but now calls `*_prompt_info` first
 * Introduce `SCM_CHANGE` to store the changeset id
 * Introduce `SCM_BRANCH` to store the branch name
2011-10-09 14:24:10 -04:00
Ryan Kanno 758c57621a Removed variables specific to hawaii50 theme :) 2011-06-18 10:07:26 -10:00
JFSIII ccab485f74 Reverting alterations introduced in 3dc4620320 Moved SCM_NON_CHAR change to theme since it is theme-specific and shouldn't affect all themes. 2011-06-18 11:55:22 -04:00
JFSIII 65ce6fdb6f Merge branch 'master' of https://github.com/desandro/bash-it 2011-06-17 22:48:07 -04:00
Daniel Leavitt bb99031325 Added "hg_prompt_info" to base theme - it is used by scm_prompt_info 2011-06-17 14:38:49 -07:00
David DeSandro 3dc4620320 SCM_NONE_CHAR='.' -> dot if no repo 2011-06-17 10:24:04 -04:00
Ryan 0713fdc031 Added virtualenv_prompt to base.theme.bash (modeled after rvm_prompt)
Removed virtualenv/rvm from hawaii50 theme
2011-06-08 11:32:50 -10:00