Experience Linux Flavor on Windows: The Right Way to Make Your Terminal Soar

Experience Linux Flavor on Windows: The Right Way to Make Your Terminal Soar

People often ask: “Do you use zsh + oh-my-zsh on Linux every day? What about on Windows? You can’t just keep using the rigid cmd, right?”

Actually, Windows PowerShell 7 + Windows Terminal

can provide an experience comparable to zsh, with command completion, history search, fuzzy jumping, and cool themes all set up!

Today, I will share a “foolproof” configuration process that will transform your Windows terminal into a productivity tool.

  1. Why not use zsh?

To be honest, running zsh on Windows requires either WSL or Cygwin/MSYS2, which is not only troublesome but also may not be stable. Those who have tinkered with WSL know that there are many pitfalls; during development, I encountered an issue where the @types folder was empty when initializing a taro project, leading to type error prompts for my packages. I tried various methods, and even AI analysis couldn’t resolve it. Later, I switched to PowerShell and reinstalled the dependencies, which solved the problem.

PowerShell 7 is already very powerful, and with community modules and tool support, it can completely achieve an effect comparable to oh-my-zsh.

  1. Preparation

First, you need:

Windows Terminal (download directly from the Microsoft Store)

PowerShell 7 (don’t use the outdated built-in PowerShell 5.1, go to GitHub for the latest version)

  1. Install plugins; completion is essential

Execute the following in PowerShell:

Set-ExecutionPolicy RemoteSigned -Scope CurrentUser -Force
Install-Module PSReadLine -Scope CurrentUser -Force   # Command completion & history prediction
Install-Module posh-git -Scope CurrentUser -Force     # Git status prompt
Install-Module PSFzf -Scope CurrentUser -Force        # Fuzzy search
Install-Module z -Scope CurrentUser -Force            # Quick directory jump

Having just these modules is not enough; you need a powerful tool:

<span>winget install fzf</span>

(fzf is the soul of fuzzy searching; after installation, you can soar with Ctrl+R and Ctrl+T)

  1. Your terminal should also look good

In the Linux world, everyone uses powerlevel10k, and on Windows, we have <span>oh-my-posh</span>:

<span>winget install JanDeDobbeleer.OhMyPosh -s winget</span>

It can help you display git branches, time, Python virtual environments, etc., making the terminal no longer cold and lifeless.

  1. One-click configuration

All configurations are written in <span>$PROFILE</span> (equivalent to Linux’s <span>~/.zshrc</span>).

Execute:

<span>notepad $PROFILE</span>

Paste the following content:

Import-Module PSReadLine

Import-Module posh-git

Import-Module PSFzf

Import-Module z

## Command completion & history prediction

Set-PSReadLineOption -PredictionSource HistoryAndPlugin

Set-PSReadLineOption -PredictionViewStyle ListView

Set-PSReadLineKeyHandler -Key Tab -Function MenuComplete

Set-PSReadLineOption -EditMode Emacs  # Ctrl+R search history

## oh-my-posh theme

oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH\jandedobbeleer.omp.json" | Invoke-Expression

Save and exit, then restart Windows Terminal.

Boom! Your terminal is now different.

  1. Usage effects
  • <span>Tab</span> → Intelligent completion

  • <span>Ctrl+R</span> → Fuzzy search history commands

  • <span>Ctrl+T</span> → Fuzzy file search

  • <span>z project</span> → Instantly jump to your frequently visited directories

  • The command prompt looks stunning

This experience is basically the Windows version of zsh + oh-my-zsh.

Conclusion

In fact, many people still think of the Windows terminal as “poor” and “not as good as Linux”.

But if you have used Windows Terminal + PowerShell 7 + this configuration, you will find it is a completely different world:

Smooth completion, efficient searching, and stunning visuals.

If you are also developing on Windows, just copy the commands above into the terminal, and you can experience this “upgraded terminal”; you will definitely love it.

Leave a Comment