Commit Graph

124 Commits

Author SHA1 Message Date
Kevin Ballard
2bb7c587f4 Skip over /etc/paths.d entries that don't exist
I had an old /etc/paths.d/TeX file that listed a path /usr/texbin that
doesn't exist anymore. This was causing the `set PATH` to print a
warning.
2016-02-26 20:26:24 -08:00
Kevin Ballard
2187c0a84b Standardize indentation in config.fish 2016-02-26 20:22:59 -08:00
Fabian Homborg
c1b384e5d3 Add functions and configuration snippets hierarchy
This allows "vendors" (i.e. third-party upstreams interested in
supporting fish) to add auto-loaded functions and eager-loaded
configuration "snippets", while still allowing both the user and the administrator to
fully override all of that.

This has been inspired by systemd's configuration hierarchy, and implements a similar scheme
whereby files with the same name in higher-ranking directories override files in lower-ranking ones.

Fixes #1956
2016-02-26 12:14:55 +01:00
Fabian Homborg
1a12071a48 Immediately define command-not-found handler
This skips the weird dance where we'd define a simple handler and then
later overwrite with a fancier one, once the first event came in.

It turns out that isn't necessary, as it doesn't actually improve
startup speed because the checks needed to define fancier handlers are fast.

In case we are non-interactive, still define the simple handler, and
keep the default handler for users to switch to.
2015-12-30 16:26:54 +01:00
Fabian Homborg
2f3123e175 Make overriding cnf-handler work
See #1925: This allows users to disable the cnf-logic which can be quite
slow on small hardware (like a raspberry pi).

Squashed commit of the following:

commit 742a59e30d8db24b6bb5067d4204d4b5cc01c1c3
Author: Fabian Homborg <FHomborg@gmail.com>
Date:   Sun Aug 30 18:23:41 2015 +0200

    Erase startup cnf-handler early

    Simplifies the code a bit - in particular it removes the special-casing
    from the startup handler.

commit 638a97e7f31f302b65e044c93c638c03a69e31f5
Author: Fabian Homborg <FHomborg@gmail.com>
Date:   Mon Aug 24 20:14:46 2015 +0200

    Make overriding cnf-handler work

    Do this by renaming the __fish_command_not_found_handler used during
    startup to __fish_startup_command_not_found_handler. That allows us to
    check if __fish_command_not_found_handler has been defined and skip the
    setup of the normal one.

    Now disabling cnf-handling can be done via defining an empty
    __fish_command_not_found_handler in config.fish
2015-08-31 18:39:15 +02:00
ridiculousfish
6faac2d2c8 Revert "Source files /etc/profile.d/*.fish at startup"
Per discussion in #1956, back this out until we have consensus.

This reverts commit 20a6b65b25.
2015-04-14 10:08:40 -07:00
ridiculousfish
20a6b65b25 Source files /etc/profile.d/*.fish at startup
Fixes #1956
2015-03-24 16:46:25 -07:00
David Adam
5157ac30fa Create and use $DATADIR/vendor_completions.d/ for upstream completions
Closes #1485.
2014-10-01 21:28:01 +08:00
David Adam
a186f04f15 Manpage completions: store in $XDG_DATA_HOME
Closes #1343, works towards #1257.
2014-09-29 19:39:36 +08:00
Kevin Ballard
f549ada16c Set up fish_{function,complete}_path properly
In the base config.fish, fish_function_path and fish_complete_path have
$__fish_datadir/{functions,completions} added to them if not already
present. For some reason they were replacing the final path component
instead of being added on to the end.
2014-08-22 11:54:58 -07:00
ridiculousfish
3ab954644f Make fish install a command_not_found handler in non-interactive uses.
Previously, fish's command_not_found handler would be installed in
__fish_config_interactive. Errors that occured early in startup (e.g. in
config.fish) or in non-interactive mode would therefore not be reported.
With this change, fish now exposes its default cnf handler as
__fish_default_command_not_found_handler . config.fish then installs a
cnfh that invokes the default. When fish goes interactive, the initial
cnfh is overwritten with a fancier one, that may in turn fall back to
invoking the default.
2014-02-20 10:26:57 -08:00
Konrad Borowski
5c96bca1ca Revert "Ensure that UTF-8 works if LANG contains it."
This was a really stupid change that I should have tested more
before pushing. It broke any non-interactive usage, such as SSH,
fish config, or parsing the script output, as config.fish is
loaded for everything.

There are no issues with different terminal emulators, so this
change will be pushed in the future, but only running in interactive
mode. I apologize for any issues caused by this commit.

This reverts commit d61adfbc53.
2013-12-17 20:47:14 +01:00
Konrad Borowski
d61adfbc53 Ensure that UTF-8 works if LANG contains it.
Some people like to have their terminals claim UTF-8 support when
their terminals actually are set to another encoding. As nobody
appears to understand this, I have made a change to automatically
fix the encoding problems if possible. This uses ISO 2022 sequences
in order to dynamically change the encoding.

Fixes #692. Fixes #895. Fixes possible future issues about this.
2013-12-15 11:08:15 +01:00
Jay Weisskopf
9bbda857c3 Prepend user paths even if they already exist in system path
Fixes #1099
2013-12-10 12:52:04 -05:00
ridiculousfish
9f46881c16 Fix to respect the order of paths in /etc/paths (oops) 2013-08-25 14:02:03 -07:00
ridiculousfish
dead45fa67 Rearrange the PATH to respect the order defined in /etc/paths (#927) and
to prepend it to $PATH instead of appending it (#950)
2013-08-25 13:27:52 -07:00
ridiculousfish
88efc73797 Actually commit the no-scope-shadowing to . function 2013-08-17 17:04:16 -07:00
Konrad Borowski
5818289c2d Deprecate "." command. Fixes #310.
Needs documentation (for the new name), but manages to move . to source,
while preserving compatibility.
2013-08-14 18:43:09 +03:00
Konrad Borowski
7e7b50cd74 Put user paths at beginning 2013-06-22 17:15:43 +02:00
ridiculousfish
d99c2cb9a7 Support /etc/paths and /etc/paths.d/* on OS X
https://github.com/fish-shell/fish-shell/issues/417
2013-02-22 14:01:17 -08:00
ridiculousfish
aaa0c25ff7 Large set of changes to how PATH is handled. Changed fish to no longer modify PATH in share/config.fish. Introduced variable fish_user_paths, and a glue function __fish_reconstruct_path that splices together PATH with fish_user_paths. Changed fish to no longer validate changes to PATH unless the paths are new (i.e. don't recheck what's already there). Modified certain sets to store const wchar_t instead of wcstring to save a few allocations.
https://github.com/fish-shell/fish-shell/issues/527
2013-02-19 18:05:20 -08:00
ridiculousfish
e7c1cb7185 Move autogenerated completions to ~/.config/fish/generated_completions/
https://github.com/fish-shell/fish-shell/issues/576
2013-02-17 16:14:36 -08:00
ridiculousfish
cd276030c1 Tweak config.fish to only modify PATH once, for performance 2013-02-01 17:18:12 -08:00
ridiculousfish
4912967eab Large set of changes related to making fish relocatable, and improving the build and install story.
- etc/config.fish and share/config.fish are now "universal" and no longer reference install paths or need to be touched by autotools. They've been removed from config.fish.in to config.fish.
- fish now attempts to determine __fish_datadir and __fish_sysconfdir relative to the path of the fish executable itself (typically by walking up one directory). This means that you can copy the directory hierarchy around and things will still work. The compiled-in paths are used as a backup.
- The fish Xcode project now can build fish natively, without needing autotools.
- Version bumped to 2.0
2012-07-08 15:20:39 -07:00