From ccda97343f3732067ebc7957d2feb1703129aadf Mon Sep 17 00:00:00 2001 From: Kid <44045911+kidonng@users.noreply.github.com> Date: Mon, 21 Jun 2021 19:51:11 +0800 Subject: [PATCH 1/7] Skip rest of the config if not in interactive mode --- conf.d/fzf.fish | 3 +++ 1 file changed, 3 insertions(+) diff --git a/conf.d/fzf.fish b/conf.d/fzf.fish index f53f2025..277eed65 100644 --- a/conf.d/fzf.fish +++ b/conf.d/fzf.fish @@ -4,6 +4,9 @@ # # This variable is global so that it can be referenced by fzf_configure_bindings and in tests set --global _fzf_search_vars_command '_fzf_search_variables (set --show | psub) (set --names | psub)' +# Skip rest of the config if not in interactive mode to speed shell startup a little +status is-interactive || exit + # Install the default bindings, which are mnemonic and minimally conflict with fish's preset bindings fzf_configure_bindings From d41499bbfcb1d1f8018bf4956a180e2f6f65b268 Mon Sep 17 00:00:00 2001 From: Kid <44045911+kidonng@users.noreply.github.com> Date: Mon, 21 Jun 2021 19:57:35 +0800 Subject: [PATCH 2/7] Run tests in interactive shell Not sure if this is the correct way to configure it --- .github/workflows/continuous_integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/continuous_integration.yml b/.github/workflows/continuous_integration.yml index 17dedc17..6b9f564b 100644 --- a/.github/workflows/continuous_integration.yml +++ b/.github/workflows/continuous_integration.yml @@ -28,7 +28,7 @@ jobs: - name: Run full test suite run: fishtape tests/*/*.fish - shell: fish {0} + shell: fish --interactive {0} # timeout in case tests get stuck on fzf timeout-minutes: 3 From 8cd6f5dbe192e808068263aa1edb1b1a4fb31e81 Mon Sep 17 00:00:00 2001 From: Kid <44045911+kidonng@users.noreply.github.com> Date: Mon, 21 Jun 2021 20:06:27 +0800 Subject: [PATCH 3/7] Revert --- .github/workflows/continuous_integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/continuous_integration.yml b/.github/workflows/continuous_integration.yml index 6b9f564b..17dedc17 100644 --- a/.github/workflows/continuous_integration.yml +++ b/.github/workflows/continuous_integration.yml @@ -28,7 +28,7 @@ jobs: - name: Run full test suite run: fishtape tests/*/*.fish - shell: fish --interactive {0} + shell: fish {0} # timeout in case tests get stuck on fzf timeout-minutes: 3 From b21435fb767be6fd3172f0b7e91bdd7f9bd0ca2a Mon Sep 17 00:00:00 2001 From: Kid <44045911+kidonng@users.noreply.github.com> Date: Mon, 21 Jun 2021 20:12:54 +0800 Subject: [PATCH 4/7] Fix CI --- conf.d/fzf.fish | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/conf.d/fzf.fish b/conf.d/fzf.fish index 277eed65..3e7218b1 100644 --- a/conf.d/fzf.fish +++ b/conf.d/fzf.fish @@ -5,7 +5,12 @@ set --global _fzf_search_vars_command '_fzf_search_variables (set --show | psub) (set --names | psub)' # Skip rest of the config if not in interactive mode to speed shell startup a little -status is-interactive || exit +# Check for $CI environment variable [1] before fishtape issue [2] is resolved +# [1] https://github.com/jorgebucaran/fishtape/issues/63 +# [2] https://docs.github.com/actions/reference/environment-variables#default-environment-variables +if not status is-interactive && test "$CI" != true + exit +end # Install the default bindings, which are mnemonic and minimally conflict with fish's preset bindings fzf_configure_bindings From e7c1b6015a85bb0ef9e2403c9dc89df8c5a406d6 Mon Sep 17 00:00:00 2001 From: Kid <44045911+kidonng@users.noreply.github.com> Date: Mon, 21 Jun 2021 20:13:39 +0800 Subject: [PATCH 5/7] UP --- conf.d/fzf.fish | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf.d/fzf.fish b/conf.d/fzf.fish index 3e7218b1..a0b77fdd 100644 --- a/conf.d/fzf.fish +++ b/conf.d/fzf.fish @@ -4,7 +4,7 @@ # # This variable is global so that it can be referenced by fzf_configure_bindings and in tests set --global _fzf_search_vars_command '_fzf_search_variables (set --show | psub) (set --names | psub)' -# Skip rest of the config if not in interactive mode to speed shell startup a little +# Skip rest of the config if not in interactive mode to speed up shell startup # Check for $CI environment variable [1] before fishtape issue [2] is resolved # [1] https://github.com/jorgebucaran/fishtape/issues/63 # [2] https://docs.github.com/actions/reference/environment-variables#default-environment-variables From eb7bef381a2dece0ee80d35eff86485ccaa5b4ba Mon Sep 17 00:00:00 2001 From: Kid <44045911+kidonng@users.noreply.github.com> Date: Mon, 21 Jun 2021 20:14:16 +0800 Subject: [PATCH 6/7] Fix link order --- conf.d/fzf.fish | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conf.d/fzf.fish b/conf.d/fzf.fish index a0b77fdd..fbf7fea6 100644 --- a/conf.d/fzf.fish +++ b/conf.d/fzf.fish @@ -6,8 +6,8 @@ set --global _fzf_search_vars_command '_fzf_search_variables (set --show | psub) # Skip rest of the config if not in interactive mode to speed up shell startup # Check for $CI environment variable [1] before fishtape issue [2] is resolved -# [1] https://github.com/jorgebucaran/fishtape/issues/63 -# [2] https://docs.github.com/actions/reference/environment-variables#default-environment-variables +# [1] https://docs.github.com/actions/reference/environment-variables#default-environment-variables +# [2] https://github.com/jorgebucaran/fishtape/issues/63 if not status is-interactive && test "$CI" != true exit end From 7baa9fea1f7b2be1d342fe7115aaa9153c11a2be Mon Sep 17 00:00:00 2001 From: Patrick Fong Date: Sat, 26 Jun 2021 10:44:20 -0700 Subject: [PATCH 7/7] skip all of config if not interactive --- conf.d/fzf.fish | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/conf.d/fzf.fish b/conf.d/fzf.fish index fbf7fea6..6cb888f0 100644 --- a/conf.d/fzf.fish +++ b/conf.d/fzf.fish @@ -1,16 +1,14 @@ +# fzf.fish is only meant to be used in interactive mode. If not in interactive mode and not in CI, skip the config to speed up shell startup +if not status is-interactive && test "$CI" != true + exit +end + # Because of scoping rules, to capture the shell variables exactly as they are, we must read # them before even executing _fzf_search_variables. We use psub to store the # variables' info in temporary files and pass in the filenames as arguments. # # This variable is global so that it can be referenced by fzf_configure_bindings and in tests set --global _fzf_search_vars_command '_fzf_search_variables (set --show | psub) (set --names | psub)' -# Skip rest of the config if not in interactive mode to speed up shell startup -# Check for $CI environment variable [1] before fishtape issue [2] is resolved -# [1] https://docs.github.com/actions/reference/environment-variables#default-environment-variables -# [2] https://github.com/jorgebucaran/fishtape/issues/63 -if not status is-interactive && test "$CI" != true - exit -end # Install the default bindings, which are mnemonic and minimally conflict with fish's preset bindings fzf_configure_bindings