You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if [[ $-==*i* ]]
thenecho'interactive shell'elseecho'non-interactive shell'fi
Startup source order
if the shell runs in login mode (the interactive flag is ignored) and --noprofile is not provided (which skips sourcing startup files), the following files will be sourced:
/etc/profile, which sources next files:
/etc/bash.bashrc
/etc/profile.d/*.sh
checks the following files in order and sources only the first one found:
~/.bash_profile - usually missing
~/.bash_login - usually missing
~/.profile - present by default, sources next file:
~/.bashrc
on shell exit sources ~/.bash_logout
if the shell runs in non-login mode:
and interactive and --norc is not provided (skips sourcing startup files), next files will be sourced:
/usr/share/fish/config.fish sources the following files. If any have duplicate basenames (/some/path/dir.fish -> dir.fish), only the first will be sourced:
$__fish_config_dir/conf.d/*.fish
$__fish_sysconf_dir/conf.d/*.fish
loop through $__fish_vendor_confdirs paths for *.fish
$__fish_sysconf_dir/config.fish
$__fish_config_dir/config.fish
Lazy load
In fish, functions and completions are lazily loaded, which means they aren't sourced until they're typed or run.
For example, to run a custom function named hello, store it in a file such as $__fish_config_dir/functions/hello.fish. There are two side effects:
If there are two identically named function files, only the first one will be sourced.
If there are additional commands in the function file, or even another function, they will be called once.
New paths can be added by appending them to the fish_function_path and fish_complete_path variables without requiring a reload. If there are multiple identical functions or completions in the path, the first one found takes precedence.
Lookup paths for functions:
$__fish_config_dir/functions
$__fish_sysconf_dir/functions
$__fish_vendor_functionsdirs
$__fish_data_dir/functions
Lookup paths for completions:
$__fish_config_dir/completions
$__fish_sysconf_dir/completions
$__fish_vendor_completionsdirs
$__fish_data_dir/completions
$__fish_user_data_dir/generated_completions - generated by fish_update_completions command