mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 12:53:13 +00:00
Create empty directories and files on interactive startup (#7796)
Closes #7402
This commit is contained in:
parent
76af09a507
commit
bcbfd70d41
2 changed files with 12 additions and 0 deletions
|
@ -19,6 +19,8 @@ Interactive improvements
|
|||
- Commands that wrap ``cd`` (using ``complete --wraps cd``) get the same completions as ``cd`` (:issue:`4693`).
|
||||
- Arguments longer than 1024 characters no longer trigger excessive CPU usage on Mac (:issue:`7837`).
|
||||
|
||||
- Fish now automatically creates ``config.fish`` and the configuration directories in ``$XDG_CONFIG_HOME/fish`` (by default ``~/.config/fish``) if they do not already exist.
|
||||
|
||||
New or improved bindings
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
|
|
|
@ -266,6 +266,16 @@ function __fish_config_interactive -d "Initializations that should be performed
|
|||
__update_cwd_osc # Run once because we might have already inherited a PWD from an old tab
|
||||
end
|
||||
|
||||
# Create empty configuration directores if they do not already exist
|
||||
test -e $__fish_config_dir/completions/ -a -e $__fish_config_dir/conf.d/ -a -e $__fish_config_dir/functions/ ||
|
||||
mkdir -p $__fish_config_dir/{completions, conf.d, functions}
|
||||
|
||||
# Create config.fish with some boilerplate if it does not exist
|
||||
test -e $__fish_config_dir/config.fish || echo "\
|
||||
if status is-interactive
|
||||
# Commands to run in interactive sessions can go here
|
||||
end" >$__fish_config_dir/config.fish
|
||||
|
||||
# Bump this whenever some code below needs to run once when upgrading to a new version.
|
||||
# The universal variable __fish_initialized is initialized in share/config.fish.
|
||||
set __fish_initialized 3100
|
||||
|
|
Loading…
Reference in a new issue