diff --git a/completions/export b/completions/export index 60fa0de47f2..e7db3a97472 100644 --- a/completions/export +++ b/completions/export @@ -52,7 +52,7 @@ _export() return fi local suffix="" - if ! $remove; then + if ! $remove && [[ $action != function ]]; then suffix="=" compopt -o nospace fi diff --git a/test/t/test_export.py b/test/t/test_export.py index 8738913ad1c..97b9d1a0ec8 100644 --- a/test/t/test_export.py +++ b/test/t/test_export.py @@ -1,5 +1,7 @@ import pytest +from conftest import assert_bash_exec + class TestExport: @pytest.mark.complete("export BASH") @@ -34,3 +36,13 @@ def test_7(self, completion): @pytest.mark.complete("export -", require_cmd=True) def test_8(self, completion): assert completion + + @pytest.fixture(scope="class") + def export_f_canary(self, request, bash): + assert_bash_exec(bash, "_comp__test_export_f_canary() { return; }") + + @pytest.mark.complete("export -f _comp__test_export_f_canar") + def test_no_equals_sign_for_function(self, completion, export_f_canary): + assert completion + assert "=" not in "".join(completion) + assert completion.endswith(" ")