Skip to content

Ask to install installable builds on interactive launch - #10899

Merged
faho merged 2 commits into
fish-shell:masterfrom
faho:auto-install
Dec 13, 2024
Merged

faho merged 2 commits into
fish-shell:masterfrom
faho:auto-install

Conversation

@faho

@faho faho commented Dec 11, 2024 •

Copy link
Copy Markdown
Member

Description

One downside installable builds currently have is the need to run fish --install every so often.

This makes it so interactive runs (real interactive runs, fish -i doesn't suffice, you need a terminal so we can ask) do that automatically, including asking for it.

That means you can do

> ~/.cargo/bin/fish
Warning: Fish's asset files are missing or out of date. Trying to install them.
This will write fish's data files to '/home/alfa/.local/share/fish/install'.
Please enter 'yes' to continue.
> yes
# and the prompt shows, we're in a session

You can still decline (by entering anything other than "yes"). If the files are missing, it will run without reading any config - this is quite uncomfortable, it won't even have the regular keybindings. (if they are outdated, things will "most likely" work out okay, but it will ask again next run)

Notably, for non-interactive runs, this won't install automatically, and it won't even complain about outdated files anymore.

If the files don't exist, on the other hand, it will print an error and then run.

TODOs:

  • Changes to fish usage are reflected in user documentation/manpages.
  • Tests have been added for regressions fixed
  • User-visible changes noted in CHANGELOG.rst

@faho faho added this to the fish 4.0 milestone Dec 11, 2024
@faho faho changed the title Ask to install installable builds on first launch Ask to install installable builds on interactive launch Dec 11, 2024
@faho

faho commented Dec 13, 2024 •

Copy link
Copy Markdown
Member Author

Okay, some spicy changes that I hope make this nicer to use:

  • fish --install now installs without asking, and does not exit
  • fish --install=noconfirm is gone

That means after you install or update this, if you just run fish, it will ask to install. If you answer yes, it will install. If you answer something else, it will still try to run, but if the files are missing it will skip all configuration.

If you want to skip the confirmation, you can run fish --install. This will still run fish, so it will give you an interactive session or run a script. If you just want to install the files, you can do fish --install -c exit.

Note: If fish wasn't built as installable, fish --install will still run fish after printing an error that it wasn't built as installable.

In total, what I hope this does is remove the need for people to think about fish being installable - they're just asked to update the assets.

I'm sure this won't be the last of it, but I'm reasonably happy with this for now.

faho added 2 commits December 13, 2024 19:07
This is fairly subtle.

When installable, and we either can't find the version file or it is
outdated, we ask the user to confirm installation (just like `--install`).

We do that only if we are really truly interactive (with a tty!) to
avoid `fish -c` running into problems.
This check could be tightened even more, because currently:

```fish
fish -ic 'echo foo'
```

asks, while

```fish
fish -ic 'echo foo' < /dev/null
```

does not.

`fish -c` will still error out if it can't find the config, but it
will just run if it is out of date.
@faho faho removed the RFC label Dec 13, 2024
@faho
faho merged commit be16eee into fish-shell:master Dec 13, 2024
@faho

faho commented Dec 13, 2024

Copy link
Copy Markdown
Member Author

Alright, I decided to just merge this now, we can work on it later.

@faho faho mentioned this pull request Dec 13, 2024
4 of 8 tasks
@faho
faho deleted the auto-install branch December 13, 2024 18:25
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Dec 22, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant