Using Fish on Windows

Table of Contents

Intro

I’m a big fan of the fish shell. I’ve been using it for many years and it’s become one of those things I can’t imagine going back from. When people look down their nose at me for using Windows, I like to gently share that I have quite a capable POSIX environment that suites me just fine.

To install your favorite shell on Windows, start with these guides:

Benefits of Fish Shell

Fish shell stands out for its focus on user experience and productivity. Unlike traditional shells like Bash or Zsh, Fish works out of the box with sensible defaults, requiring minimal configuration. Key benefits include:

  • Syntax Highlighting: Commands, options, and output are color-coded in real-time, making it easier to spot errors and understand complex commands.
  • Autosuggestions: As you type, Fish suggests completions based on your command history and available options, speeding up workflow.
  • Intelligent Tab Completion: Pressing Tab provides context-aware completions for files, directories, commands, and even man pages, reducing typing and typos.
  • User-Friendly Scripting: Fish’s syntax is clean and readable, with features like arrays and functions that are simpler than in other shells.
  • Interactive Features: Built-in help, web-based configuration, and a welcoming prompt make it ideal for both beginners and power users.

These features make Fish a joy to use daily, enhancing efficiency without the steep learning curve of other shells.

Installation

To install fish, just open up your C:\msys64\mingw64.exe console and install using pacman:

$ pacman -Sy fish

Configuration

The following sections provide examples of how to configure some of the software I’ve used with the fish shell on Windows.

Here’s a fish icon for anyone who wants it:

icon

Direct Launch

Let’s start with an easy one. You can launch fish directly by executing C:\msys64\usr\bin\fish.exe.

Windows Terminal

You can configure Windows Terminal for fish by adding the following profile to C:\Users\<user>\AppData\Local\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.json

{
    "profiles":
    {
        "list":
        [
            {
                "commandline": "\"C:\\msys64\\usr\\bin\\fish.exe\" -i -l",
                "hidden": false,
                "icon": "C:\\msys64\\mingw64\\share\\fish\\fish_shell.png",
                "name": "fish"
            }
        ]
    }
}

VS Code

You can configure a fish terminal in VS Code by adding the following sections to your settings.json.

{
    "terminal.integrated.profiles.windows": {
        "fish": {
            "path": "C:\\msys64\\usr\\bin\\fish.exe",
            "args": [
                "-i",
                "-l",
            ]
        }
    },
    "terminal.integrated.defaultProfile.windows": "fish",
}

Sublime Text - Terminus

Configure fish in your Terminus.sublime-settings file:

{
    "default_config":
    {
        "linux": null,
        "osx": null,
        "windows": "msys-fish"
    },
    "shell_configs":
    [
        {
            "name": "fish",
            "cmd": ["C:\\msys64\\usr\\bin\\fish.exe", "-i", "-l"],
            "env": {},
            "enable": true,
            "platforms": ["windows"]
        }
    ]
}

Python Virtual Environment

To create a Python virtual environment that works with fish on Windows, use the virtualenv package, as Python’s built-in venv does not generate Fish activator scripts on Windows. Pass the activators argument to specify the shells you want.

$ virtualenv --activators=bash,batch,fish,powershell,python .venv

created virtual environment CPython3.10.5.final.0-64 in 6545ms
  creator CPython3Windows(dest=C:\Users\amendlik\develop\tmp\penv\.venv, clear=False, no_vcs_ignore=False, global=False)
  seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=C:\Users\amendlik\AppData\Local\pypa\virtualenv)
    added seed packages: pip==26.0.1, setuptools==82.0.0, wheel==0.46.3
  activators BashActivator,BatchActivator,FishActivator,PowerShellActivator,PythonActivator

$ source .venv/Scripts/activate.fish