↓ Skip to main content
  1. My Projects/

Refresh your fish prompt when you run a command

This plugin refreshes your (previous) prompt when you enter a new command.

In the above video, you can notice…

  • The time on the right was updated before the command was executed– reflecting the actual time the command was executed
  • The git status was updated… The [!1 +1] (1 modified, 1 untracked file) was updated to [●6] (6 staged files)
  • After the long-running command, the command duration was shown
  • After each command, first a quick prompt without git state is rendered and later the git state pops in (thanks to @acomagu’s fish-async-prompt plugin)

But why would you want that?

Over the past decade, prompts have evolved to show an incredible amount of information, such as time, git status, dev environment, etc.

But the prompt is rendered after the previous command has finished. That’s fantastic if you are actively working on something in the terminal.

However, if you take a break, make changes in another terminal tab, in your code editor, or in a graphical git GUI, and then come back to your terminal, the prompt will display outdated information.

This is particularly annoying when you need to read over the terminal history to understand when commands were executed and how long they took.

How this plugin solves the problem

This plugin causes the prompt to be repainted before a new command is executed.

It should work with many fish prompts, but it has been designed specifically to work with the amazing starship prompt and the fish-async-prompt plugin for the highest level of customization and performance.

You can find detailed instructions on how to set up all three tools in the GitHub repository: