def append_alias_expansion()

in src/pathpicker/output.py [0:0]


def append_alias_expansion() -> None:
    # zsh by default expands aliases when running in interactive mode
    # (see ../fpp). bash (on this author's Yosemite box) seems to have
    # alias expansion off when run with -i present and -c absent,
    # despite documentation hinting otherwise.
    #
    # so here we must ask bash to turn on alias expansion.
    shell = os.environ.get("SHELL")
    if shell is None or "fish" not in shell:
        append_to_file(
            """
if type shopt > /dev/null; then
  shopt -s expand_aliases
fi
"""
        )