Compare commits

...

5 Commits

Author SHA1 Message Date
Ilan Cosman
95b415a450 Add pr attribution 2023-12-26 12:49:25 -08:00
Ilan Cosman
33926c3f3a v6.1.0 2023-12-26 12:47:19 -08:00
Ilan Cosman
78047c533d Changelog for v6.1.0 2023-12-26 12:16:37 -08:00
Ilan Cosman
3f97ee170f Use open pager as a heuristic for selecting/executing (closes #472) 2023-12-26 12:04:50 -08:00
daylily
cd94c083a4
Add job number display (#470)
* Add job number display

* Clean up, disable by default

* Update tests

---------

Co-authored-by: Ilan Cosman <ilancosman@gmail.com>
2023-12-26 12:02:03 -08:00
8 changed files with 35 additions and 12 deletions

View File

@ -1,15 +1,19 @@
# Changelog
## [v6.1.0][] (???)
## [v6.1.0][] (Dec 26 2023)
### Features
- Add a new `zig` item ([#452][] - @TheFunctionalGuy)
- Add a new `tide_jobs_number_threshold` variable, which lets you display the number of jobs if it reaches the threshold ([#470][] - @re-xyr).
- This is disabled by default by just setting it to a very high number
### Bug fixes
- Fix the `python` item only using `python` and not `python3` ([#459][])
- Fix transience not working when trying to run a command during the previous command's execution ([#455][])
- Fixed transience engaging when selecting from the pager (i.e. tab completions, history search) ([#472][])
- This does introduce a new bug where opening the pager but not selecting anything and instead running what you already have, will cause the prompt to not be transient.
## [v6.0.1][] (Oct 04 2023)
@ -566,6 +570,8 @@
[#452]: https://github.com/IlanCosman/tide/issues/452
[#455]: https://github.com/IlanCosman/tide/issues/455
[#459]: https://github.com/IlanCosman/tide/issues/459
[#470]: https://github.com/IlanCosman/tide/issues/470
[#472]: https://github.com/IlanCosman/tide/issues/472
[prettier action]: https://github.com/actionsx/prettier
[super-linter]: https://github.com/github/super-linter
[v1.0.0]: https://github.com/IlanCosman/tide/tree/v1.0.0
@ -611,3 +617,4 @@
[v5.6.0]: https://github.com/IlanCosman/tide/tree/v5.6.0
[v6.0.0]: https://github.com/IlanCosman/tide/tree/v6.0.0
[v6.0.1]: https://github.com/IlanCosman/tide/tree/v6.0.1
[v6.1.0]: https://github.com/IlanCosman/tide/tree/v6.1.0

View File

@ -1,3 +1,7 @@
function _tide_item_jobs
set -q _tide_jobs && _tide_print_item jobs $tide_jobs_icon
set -q _tide_jobs && if test $_tide_jobs -ge $tide_jobs_number_threshold
_tide_print_item jobs $tide_jobs_icon' ' $_tide_jobs
else
_tide_print_item jobs $tide_jobs_icon
end
end

View File

@ -38,7 +38,7 @@ if contains newline $_tide_left_items # two line prompt initialization
eval "
function fish_prompt
_tide_status=\$status _tide_pipestatus=\$pipestatus if not set -e _tide_repaint
jobs -q && set -lx _tide_jobs
jobs -q && jobs -p | count | read -lx _tide_jobs
$fish_path -c \"set _tide_pipestatus \$_tide_pipestatus
set _tide_parent_dirs \$_tide_parent_dirs
PATH=\$(string escape \"\$PATH\") CMD_DURATION=\$CMD_DURATION fish_bind_mode=\$fish_bind_mode set $prompt_var (_tide_2_line_prompt)\" &
@ -66,7 +66,7 @@ end"
eval "
function fish_prompt
_tide_status=\$status _tide_pipestatus=\$pipestatus if not set -e _tide_repaint
jobs -q && set -lx _tide_jobs
jobs -q && jobs -p | count | read -lx _tide_jobs
$fish_path -c \"set _tide_pipestatus \$_tide_pipestatus
set _tide_parent_dirs \$_tide_parent_dirs
PATH=\$(string escape \"\$PATH\") CMD_DURATION=\$CMD_DURATION fish_bind_mode=\$fish_bind_mode set $prompt_var (_tide_2_line_prompt)\" &
@ -98,7 +98,7 @@ else # one line prompt initialization
function fish_prompt
set -lx _tide_status \$status
_tide_pipestatus=\$pipestatus if not set -e _tide_repaint
jobs -q && set -lx _tide_jobs
jobs -q && jobs -p | count | read -lx _tide_jobs
$fish_path -c \"set _tide_pipestatus \$_tide_pipestatus
set _tide_parent_dirs \$_tide_parent_dirs
PATH=\$(string escape \"\$PATH\") CMD_DURATION=\$CMD_DURATION fish_bind_mode=\$fish_bind_mode set $prompt_var (_tide_1_line_prompt)\" &
@ -125,7 +125,7 @@ end"
eval "
function fish_prompt
_tide_status=\$status _tide_pipestatus=\$pipestatus if not set -e _tide_repaint
jobs -q && set -lx _tide_jobs
jobs -q && jobs -p | count | read -lx _tide_jobs
$fish_path -c \"set _tide_pipestatus \$_tide_pipestatus
set _tide_parent_dirs \$_tide_parent_dirs
PATH=\$(string escape \"\$PATH\") CMD_DURATION=\$CMD_DURATION fish_bind_mode=\$fish_bind_mode set $prompt_var (_tide_1_line_prompt)\" &
@ -153,9 +153,13 @@ if test "$tide_prompt_transient_enabled" = true
function _tide_enter_transient
# If the commandline will be executed, or is empty
if commandline --is-valid || test -z "$(commandline)"
set -g _tide_transient
set -g _tide_repaint
commandline -f repaint
# Pager open usually means selecting, not running
# Can be untrue, but it's better than the alternative
if not commandline --paging-mode
set -g _tide_transient
set -g _tide_repaint
commandline -f repaint
end
end
commandline -f execute
end

View File

@ -2,7 +2,7 @@ function tide --description 'Manage your Tide prompt'
argparse --stop-nonopt v/version h/help -- $argv
if set -q _flag_version
echo 'tide, version 6.0.1'
echo 'tide, version 6.1.0'
else if set -q _flag_help
_tide_help
else if functions --query _tide_sub_$argv[1]

View File

@ -46,6 +46,7 @@ tide_java_bg_color 444444
tide_java_color ED8B00
tide_jobs_bg_color 444444
tide_jobs_color $_tide_color_dark_green
tide_jobs_number_threshold 1000
tide_kubectl_bg_color 444444
tide_kubectl_color 326CE5
tide_left_prompt_frame_enabled true

View File

@ -46,6 +46,7 @@ tide_java_bg_color normal
tide_java_color ED8B00
tide_jobs_bg_color normal
tide_jobs_color $_tide_color_dark_green
tide_jobs_number_threshold 1000
tide_kubectl_bg_color normal
tide_kubectl_color 326CE5
tide_left_prompt_frame_enabled false

View File

@ -46,6 +46,7 @@ tide_java_bg_color ED8B00
tide_java_color 000000
tide_jobs_bg_color 444444
tide_jobs_color 4E9A06
tide_jobs_number_threshold 1000
tide_kubectl_bg_color 326CE5
tide_kubectl_color 000000
tide_left_prompt_frame_enabled true

View File

@ -1,9 +1,14 @@
# RUN: %fish %s
_tide_parent_dirs
set -lx tide_jobs_icon
set -lx tide_jobs_number_threshold 2
set -e _tide_jobs
_tide_decolor (_tide_item_jobs) # CHECK:
set -lx tide_jobs_icon
set -lx _tide_jobs
set -lx _tide_jobs 1
_tide_decolor (_tide_item_jobs) # CHECK: 
set -lx _tide_jobs 2
_tide_decolor (_tide_item_jobs) # CHECK:  2