mirror of
https://github.com/IlanCosman/tide.git
synced 2024-11-22 23:03:26 +03:00
Add SHLVL
item (#165)
* Add SHLVL item
* Run function in subshell
* Python bug?
* Revert "Python bug?"
This reverts commit 79fbadc29f
.
* Change icon
* Fix macOS test
* Run on Linux only
This commit is contained in:
parent
c9e4c0c14a
commit
b8f832c09d
5
functions/_tide_item_shlvl.fish
Normal file
5
functions/_tide_item_shlvl.fish
Normal file
@ -0,0 +1,5 @@
|
||||
function _tide_item_shlvl
|
||||
# Item functions run in a deeper level of shell
|
||||
set -l real_shlvl (math $SHLVL - 1)
|
||||
test $real_shlvl -gt $tide_shlvl_threshold && _tide_print_item shlvl $tide_shlvl_icon' ' $real_shlvl
|
||||
end
|
@ -69,6 +69,10 @@ tide_right_prompt_suffix ''
|
||||
tide_rustc_bg_color 444444
|
||||
tide_rustc_color 00AFAF
|
||||
tide_rustc_icon ''
|
||||
tide_shlvl_bg_color 444444
|
||||
tide_shlvl_color d78700
|
||||
tide_shlvl_icon ''
|
||||
tide_shlvl_threshold 1
|
||||
tide_status_bg_color_failure 444444
|
||||
tide_status_bg_color_success 444444
|
||||
tide_status_color_failure D70000
|
||||
|
@ -34,6 +34,8 @@ tide_pwd_color_dirs cyan
|
||||
tide_pwd_color_truncated_dirs magenta
|
||||
tide_rustc_bg_color black
|
||||
tide_rustc_color cyan
|
||||
tide_shlvl_bg_color black
|
||||
tide_shlvl_color yellow
|
||||
tide_status_bg_color_failure black
|
||||
tide_status_bg_color_success black
|
||||
tide_status_color_failure red
|
||||
|
@ -69,6 +69,10 @@ tide_right_prompt_suffix ''
|
||||
tide_rustc_bg_color normal
|
||||
tide_rustc_color 00AFAF
|
||||
tide_rustc_icon ''
|
||||
tide_shlvl_bg_color normal
|
||||
tide_shlvl_color d78700
|
||||
tide_shlvl_icon ''
|
||||
tide_shlvl_threshold 1
|
||||
tide_status_bg_color_failure normal
|
||||
tide_status_bg_color_success normal
|
||||
tide_status_color_failure D70000
|
||||
|
@ -34,6 +34,8 @@ tide_pwd_color_dirs cyan
|
||||
tide_pwd_color_truncated_dirs magenta
|
||||
tide_rustc_bg_color normal
|
||||
tide_rustc_color cyan
|
||||
tide_shlvl_bg_color normal
|
||||
tide_shlvl_color yellow
|
||||
tide_status_bg_color_failure normal
|
||||
tide_status_bg_color_success normal
|
||||
tide_status_color_failure red
|
||||
|
@ -69,6 +69,10 @@ tide_right_prompt_suffix ''
|
||||
tide_rustc_bg_color FF8700
|
||||
tide_rustc_color 2E3436
|
||||
tide_rustc_icon ''
|
||||
tide_shlvl_bg_color 808000
|
||||
tide_shlvl_color 000000
|
||||
tide_shlvl_icon ''
|
||||
tide_shlvl_threshold 1
|
||||
tide_status_bg_color_failure CC0000
|
||||
tide_status_bg_color_success 2E3436
|
||||
tide_status_color_failure FFFF00
|
||||
|
@ -34,6 +34,8 @@ tide_pwd_color_dirs brwhite
|
||||
tide_pwd_color_truncated_dirs white
|
||||
tide_rustc_bg_color yellow
|
||||
tide_rustc_color black
|
||||
tide_shlvl_bg_color yellow
|
||||
tide_shlvl_color black
|
||||
tide_status_bg_color_failure red
|
||||
tide_status_bg_color_success black
|
||||
tide_status_color_failure bryellow
|
||||
|
12
tests/_tide_item_shlvl.test.fish
Normal file
12
tests/_tide_item_shlvl.test.fish
Normal file
@ -0,0 +1,12 @@
|
||||
# RUN: %fish %s
|
||||
# REQUIRES: test $(uname) = Linux
|
||||
|
||||
function _shlvl
|
||||
_tide_decolor (fish -c _tide_item_shlvl)
|
||||
end
|
||||
|
||||
_shlvl # CHECK: 2
|
||||
|
||||
set -lx tide_shlvl_threshold 2
|
||||
|
||||
_shlvl # CHECK:
|
Loading…
Reference in New Issue
Block a user