diff --git a/CHANGELOG.md b/CHANGELOG.md index d549b4063..12805a6f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,6 @@ This section is for changes merged to the `major` branch that are not also merge - `?` as a glob is deprecated and will be removed in the future. (#4520). This is controlled by the `qmark-noglob` feature flag. ## Notable non-backward compatible changes -- `.` command no longer exists -- use `source` (#4294). - `read` now uses `-s` as short for `--silent` (à la `bash`); `--shell`'s abbreviation (formerly `-s`) is now `-S` instead (#4490). - `set x[1] x[2] a b` is no longer valid syntax (#4236). - `for` loop control variables are no longer local to the `for` block (#1935). diff --git a/share/config.fish b/share/config.fish index 59fa7f505..c6ccfc4e4 100644 --- a/share/config.fish +++ b/share/config.fish @@ -172,6 +172,18 @@ end # in UTF-8 (with non-ASCII characters). __fish_set_locale +# "." command for compatibility with old fish versions. +function . --description 'Evaluate contents of file (deprecated, see "source")' --no-scope-shadowing + if test (count $argv) -eq 0 + # Uses tty directly, as isatty depends on "." + and tty 0>&0 >/dev/null + echo "source: '.' command is deprecated, and doesn't work with STDIN anymore. Did you mean 'source' or './'?" >&2 + return 1 + else + source $argv + end +end + # As last part of initialization, source the conf directories. # Implement precedence (User > Admin > Extra (e.g. vendors) > Fish) by basically doing "basename". set -l sourcelist