Skip to content

Commit 3df373b

Browse files
committed
fish: re-add fish_variables
jorgebucaran/fisher#746 (comment)
1 parent 0e14cae commit 3df373b

File tree

4 files changed

+52
-9
lines changed

4 files changed

+52
-9
lines changed

Diff for: config/fish/.gitignore

-1
This file was deleted.

Diff for: config/fish/conf.d/__async_prompt.fish

+23-8
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ set -g __async_prompt_tmpdir (command mktemp -d)
66
# Setup after the user defined prompt functions are loaded.
77
function __async_prompt_setup_on_startup --on-event fish_prompt
88
functions -e (status current-function)
9+
if test "$async_prompt_enable" = 0
10+
return 0
11+
end
912

1013
for func in (__async_prompt_config_functions)
1114
function $func -V func
@@ -15,11 +18,13 @@ function __async_prompt_setup_on_startup --on-event fish_prompt
1518
end
1619
end
1720

21+
function __async_prompt_keep_last_pipestatus
22+
set -g __async_prompt_last_pipestatus $pipestatus
23+
end
24+
1825
not set -q async_prompt_on_variable
1926
and set async_prompt_on_variable fish_bind_mode
2027
function __async_prompt_fire --on-event fish_prompt (for var in $async_prompt_on_variable; printf '%s\n' --on-variable $var; end)
21-
set -l __async_prompt_last_pipestatus $pipestatus
22-
2328
for func in (__async_prompt_config_functions)
2429
set -l tmpfile $__async_prompt_tmpdir'/'$fish_pid'_'$func
2530

@@ -28,7 +33,7 @@ function __async_prompt_fire --on-event fish_prompt (for var in $async_prompt_on
2833
eval (string escape -- $func'_loading_indicator' "$last_prompt") >$tmpfile
2934
end
3035

31-
__async_prompt_config_inherit_variables | __async_prompt_last_pipestatus=$__async_prompt_last_pipestatus __async_prompt_spawn \
36+
__async_prompt_config_inherit_variables | __async_prompt_spawn \
3237
$func' | read -z prompt
3338
echo -n $prompt >'$tmpfile
3439
end
@@ -130,12 +135,10 @@ function __async_prompt_spawn -a cmd
130135
true
131136
end
132137
'$cmd'
133-
__async_prompt_signal
134-
sleep 0.3
135-
__async_prompt_signal
136-
sleep 0.3
137138
__async_prompt_signal' &
138-
disown
139+
if test (__async_prompt_config_disown) = 1
140+
disown
141+
end
139142
end
140143

141144
function __async_prompt_config_inherit_variables
@@ -181,6 +184,18 @@ function __async_prompt_config_internal_signal
181184
end
182185
end
183186

187+
function __async_prompt_config_disown
188+
if test -z "$async_prompt_disown"
189+
echo 1
190+
else
191+
echo "$async_prompt_disown"
192+
end
193+
end
194+
184195
function __async_prompt_repaint_prompt --on-signal (__async_prompt_config_internal_signal)
185196
commandline -f repaint >/dev/null 2>/dev/null
186197
end
198+
199+
function __async_prompt_tmpdir_cleanup --on-event fish_exit
200+
rm -rf "$__async_prompt_tmpdir"
201+
end

Diff for: config/fish/conf.d/_z-make-portable.fish

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Don't use set -U here
2+
# set -U stores the actual value of $HOME in the fish_variables file
3+
# which is tracked in the dotfiles repo.
4+
# This makes it non-portable.
5+
set -x Z_DATA $HOME/.local/share/z/data
6+
set -xp Z_EXCLUDE $HOME

Diff for: config/fish/fish_variables

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# This file contains fish universal variable definitions.
2+
# VERSION: 3.0
3+
SETUVAR ZO_CMD:zo
4+
SETUVAR Z_CMD:z
5+
SETUVAR __fish_initialized:3400
6+
SETUVAR _fisher_acomagu_2F_fish_2D_async_2D_prompt_files:\x7e/\x2econfig/fish/conf\x2ed/__async_prompt\x2efish
7+
SETUVAR _fisher_itsfarseen_2F_nvm_2E_fish_files:\x7e/\x2econfig/fish/functions/_nvm_index_update\x2efish\x1e\x7e/\x2econfig/fish/functions/_nvm_list\x2efish\x1e\x7e/\x2econfig/fish/functions/_nvm_version_activate\x2efish\x1e\x7e/\x2econfig/fish/functions/_nvm_version_deactivate\x2efish\x1e\x7e/\x2econfig/fish/functions/nvm\x2efish\x1e\x7e/\x2econfig/fish/conf\x2ed/nvm\x2efish\x1e\x7e/\x2econfig/fish/completions/nvm\x2efish
8+
SETUVAR _fisher_jethrokuan_2F_z_files:\x7e/\x2econfig/fish/functions/__z\x2efish\x1e\x7e/\x2econfig/fish/functions/__z_add\x2efish\x1e\x7e/\x2econfig/fish/functions/__z_clean\x2efish\x1e\x7e/\x2econfig/fish/functions/__z_complete\x2efish\x1e\x7e/\x2econfig/fish/conf\x2ed/z\x2efish
9+
SETUVAR _fisher_jorgebucaran_2F_autopair_2E_fish_files:\x7e/\x2econfig/fish/functions/_autopair_backspace\x2efish\x1e\x7e/\x2econfig/fish/functions/_autopair_insert_left\x2efish\x1e\x7e/\x2econfig/fish/functions/_autopair_insert_right\x2efish\x1e\x7e/\x2econfig/fish/functions/_autopair_insert_same\x2efish\x1e\x7e/\x2econfig/fish/functions/_autopair_tab\x2efish\x1e\x7e/\x2econfig/fish/conf\x2ed/autopair\x2efish
10+
SETUVAR _fisher_jorgebucaran_2F_fisher_files:\x7e/\x2econfig/fish/functions/fisher\x2efish\x1e\x7e/\x2econfig/fish/completions/fisher\x2efish
11+
SETUVAR _fisher_plugins:jorgebucaran/fisher\x1ejorgebucaran/autopair\x2efish\x1eacomagu/fish\x2dasync\x2dprompt\x1ejethrokuan/z\x1eitsfarseen/nvm\x2efish
12+
SETUVAR _fisher_upgraded_to_4_4:\x1d
13+
SETUVAR fish_color_cancel:\x2dr
14+
SETUVAR fish_color_cwd:green
15+
SETUVAR fish_color_cwd_root:red
16+
SETUVAR fish_color_history_current:\x2d\x2dbold
17+
SETUVAR fish_color_host:normal
18+
SETUVAR fish_color_host_remote:yellow
19+
SETUVAR fish_color_status:red
20+
SETUVAR fish_color_user:brgreen
21+
SETUVAR fish_color_valid_path:\x2d\x2dunderline
22+
SETUVAR fish_greeting:\x1d
23+
SETUVAR fish_key_bindings:fish_default_key_bindings

0 commit comments

Comments
 (0)