Skip to content

Commit 06c3d7e

Browse files
committed
✨ Add command to enable/disable user symbol on prompt for human theme
New commands: - fancygit --enable-user-symbol - fancygit --disable-user-symbol
1 parent 825ac43 commit 06c3d7e

File tree

5 files changed

+12
-0
lines changed

5 files changed

+12
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,8 @@ Type `fancygit -h` to see all available feature switchers on **"FEATURE SWITCHER
193193
| fancygit --disable-bold-prompt | Show regular prompt font.
194194
| fancygit --enable-host-name | Show host name.
195195
| fancygit --disable-host-name | Hide host name.
196+
| fancygit --enable-user-symbol | Show user symbol.
197+
| fancygit --disable-user-symbol | Hide user symbol.
196198
| fancygit --set-user-name {name} | Set the user name.
197199
| fancygit --unset-user-name | Restore the user name to default.
198200
| fancygit --set-host-name {name} | Set the host name.

app_config_sample

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ user_name:
1212
host_name:
1313
bold_prompt:false
1414
show_host_prompt:false
15+
show_user_symbol_prompt:false
1516
fresh_file

commands-handler.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ case "$1" in
4242
"--disable-bold-prompt") fancygit_config_save "bold_prompt" "false";;
4343
"--enable-host-name") fancygit_config_save "show_host_prompt" "true";;
4444
"--disable-host-name") fancygit_config_save "show_host_prompt" "false";;
45+
"--enable-user-symbol") fancygit_config_save "show_user_symbol_prompt" "true";;
46+
"--disable-user-symbol") fancygit_config_save "show_user_symbol_prompt" "false";;
4547

4648
# Set Name and Host.
4749
"--set-user-name") fancygit_config_save "user_name" "$2";;

fancygit-completion

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ _fancygit() {
2929
--disable-bold-prompt \
3030
--enable-host-name \
3131
--disable-host-name \
32+
--enable-user-symbol \
33+
--disable-user-symbol \
3234
--set-user-name \
3335
--unset-user-name \
3436
--set-host-name \

themes/human.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,11 @@ fancygit_theme_builder() {
8484
prompt_symbol="${user_symbol}\$${user_symbol_end}"
8585
prompt_path="${path}${path_sign}${path_end}${color_reset}"
8686

87+
if fancygit_config_is "show_user_symbol_prompt" "false"
88+
then
89+
prompt_symbol=""
90+
fi
91+
8792
if [ "$branch_status" != "" ]
8893
then
8994
branch="${branch_color_changed_files_font_tag}"

0 commit comments

Comments
 (0)