A one-run script that automatically sets up a beautiful and powerful terminal environment for both Windows PowerShell and Linux/WSL!
- 🎯 One-click setup - No more 5 manual steps!
- 🔄 Cross-platform - Works on Windows, Linux, WSL, and macOS
- 🤖 Smart detection - Automatically detects your environment
- ⚡ Modern tools - Uses the latest terminal enhancements
# Download and run the setup script
curl -fsSL https://raw.githubusercontent.com/aymaneallaoui/setup-terminal/master/setup.sh | bashOr download and run manually:
# Clone the repository
git clone https://github.com/aymaneallaoui/setup-terminal.git
cd setup-terminal
# Make the script executable and run it
chmod +x setup.sh
./setup.shIf you're on Windows and prefer PowerShell:
# Run directly in PowerShell
iwr -useb https://raw.githubusercontent.com/aymaneallaoui/setup-terminal/master/setup.ps1 | iexsetup.sh is safe to re-run and accepts a few flags:
./setup.sh # full setup, auto-detect (installs & uses zsh)
./setup.sh --shell bash # configure bash only, don't install zsh
./setup.sh --no-chsh -y # set up zsh but keep your current default shell
./setup.sh --no-install # just (re)write configs for already-installed tools
./setup.sh --dry-run # preview every action without changing anything
./setup.sh --help # full list of options| Flag | Description |
|---|---|
--shell <auto|zsh|bash> |
Which shell to configure (default auto → zsh) |
--no-chsh |
Don't change your default login shell |
--no-install |
Configure only; skip installing packages/tools |
--nerd-font |
Also install FiraCode Nerd Font (native Linux/macOS) |
-y, --yes, --unattended |
Don't prompt; assume yes |
-n, --dry-run |
Show what would happen, make no changes |
-h, --help |
Show help |
Re-running never duplicates anything: all settings live in
~/.config/terminal-setup/and are wired into your rc files via a single managed block. Your original~/.bashrc/~/.zshrcis backed up once to*.uts-backup.
Use Ctrl + F to search for files and Ctrl + R to search command history

Git commands auto-completion: git ch + Tab → git checkout
PowerShell commands auto-completion: Get- + Tab → Get-Command
- Starship - the single, fast prompt for both Bash and Zsh. Ships a Nerd-Font-free
starship.tomlso it renders cleanly even on a default WSL terminal. - fzf - fuzzy finder (Ctrl+R history, Ctrl+T / Ctrl+F files). Key bindings are wired up reliably, even on slim/Docker/imported-WSL images that strip the packaged integration files.
- Zsh + Oh My Zsh with plugins:
- zsh-autosuggestions
- zsh-syntax-highlighting
- zsh-history-substring-search
- Bash is always configured too (same prompt, aliases, history and fzf bindings), so things work even if you skip Zsh or
chshis unavailable. - Git aliases and sensible shell defaults
- WSL integration - clipboard, opening files/URLs in Windows, browser bridging (see WSL Specific Issues)
All settings live in ~/.config/terminal-setup/ and are wired into your rc files through a single managed block, so re-running is safe and never duplicates configuration.
- Oh My Posh - Beautiful prompt system
- Scoop - Package manager for Windows
- PowerShell modules:
- PSReadLine - Enhanced command line editing
- Terminal-Icons - File and folder icons
- Posh-Git - Git integration
- PSFzf - Fuzzy finder integration
- fzf - File and history search
- Git aliases and auto-completion
| Shortcut | Function |
|---|---|
Ctrl + R |
Fuzzy-search command history |
Ctrl + T |
Fuzzy-find files into the command line |
Ctrl + F |
Fuzzy-find files (same as Ctrl + T) |
Tab |
Auto-complete commands/paths |
↑/↓ |
History substring search (Zsh) |
pbcopy, pbpaste, and open / e work the same on every platform — the
backend is picked automatically at runtime, so the same config is portable
across machines:
| Platform | Clipboard | Open files/URLs |
|---|---|---|
| WSL | clip.exe / PowerShell |
explorer.exe, wslview |
| Linux (Wayland) | wl-copy / wl-paste |
xdg-open |
| Linux (X11) | xclip or xsel |
xdg-open |
| macOS | native | native open |
On a headless server with none of these tools, the helpers simply stay undefined (no errors). To enable them on a Linux desktop:
sudo apt install wl-clipboard # Wayland sessions
sudo apt install xclip # X11 sessionsThe setup includes these helpful git aliases:
gs # git status
ga # git add
gc # git commit
gp # git push
gpl # git pull
gl # git log --oneline --graph --decorate
gd # git diff
gb # git branch
gco # git checkout
gst # git stashThe prompt is Starship, configured in ~/.config/starship.toml. The setup
ships a clean, Nerd-Font-free config; tweak it freely or start from a preset:
# Browse presets at https://starship.rs/presets/
starship preset nerd-font-symbols -o ~/.config/starship.toml # needs a Nerd Font
starship preset plain-text-symbols -o ~/.config/starship.toml # ASCII onlyFor PowerShell:
# Edit your PowerShell profile and change the Oh My Posh theme
oh-my-posh init pwsh --config "path/to/your/theme.omp.json" | Invoke-ExpressionLinux / WSL / macOS:
Put personal tweaks in ~/.config/terminal-setup/local.sh — it's loaded last by
both Bash and Zsh and is never overwritten when you re-run the setup:
echo "alias myalias='my command'" >> ~/.config/terminal-setup/local.shPowerShell: Add to your PowerShell profile:
Set-Alias myalias 'My-Command'Make sure the script is executable:
chmod +x setup.shRun this in PowerShell as Administrator:
Set-ExecutionPolicy RemoteSigned -Scope CurrentUserThe script automatically installs dependencies, but if you encounter issues:
Linux/WSL:
sudo apt update && sudo apt install curl git build-essentialWindows: Install Git and PowerShell from their official websites.
The setup detects WSL automatically (and tells WSL1 from WSL2) and adds a few quality-of-life integrations:
Clipboard & opening things — pbcopy / pbpaste are bridged to the Windows
clipboard and open / e open files in Explorer (see the
Clipboard & Opening Files table). URLs open in your
Windows browser via wslview ($BROWSER) when wslu is installed
(sudo apt install wslu), and winhome jumps to your Windows user profile.
Fonts — the prompt is intentionally Nerd-Font-free, so it works out of the box. For richer icons, install a Nerd Font and select it in Windows Terminal:
- Download a Nerd Font (e.g., FiraCode or CaskaydiaCove Nerd Font)
- Install it in Windows
- Set it in Windows Terminal → Settings → your distro → Appearance → Font
Slow tab-completion / $PATH pollution — by default WSL appends the entire
Windows PATH, which can make completion sluggish. Disable it by adding this to
/etc/wsl.conf, then run wsl --shutdown from Windows:
[interop]
appendWindowsPath = falseStill on WSL1? WSL2 is faster and more compatible. From an elevated Windows
prompt: wsl --set-version <distro> 2.
CRLF line endings — if you cloned on Windows and run under WSL, shell scripts
can break with bad interpreter errors. This repo ships a .gitattributes that
forces LF on *.sh, and setup.sh self-heals if it detects CRLF in itself. To
fix an already-broken checkout:
sed -i 's/\r$//' setup.shIf you were using the old 5-step process:
-
Backup your current config (optional):
cp ~/.zshrc ~/.zshrc.backup cp $PROFILE $PROFILE.backup # PowerShell
-
Run the new setup:
curl -fsSL https://raw.githubusercontent.com/aymaneallaoui/setup-terminal/master/setup.sh | bash -
Restart your terminal
The new setup will automatically detect and preserve compatible configurations.
Want to improve this setup? Contributions are welcome!
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes
- Test on different environments
- Submit a pull request
The script is designed to be extensible. To add support for a new environment:
- Add detection logic in
detect_environment() - Create a new setup function (e.g.,
setup_fish()) - Add the case in the main function
- Test thoroughly
This project is open source and available under the MIT License.
- Original setup by aymaneallaoui
- Enhanced with cross-platform support
- Thanks to the maintainers of:
- Oh My Posh
- Oh My Zsh
- Starship
- fzf
- All the PowerShell and Zsh plugin authors
After installation, restart your terminal and enjoy:
- ⚡ Faster workflow with fuzzy finding
- 🎨 Beautiful, informative prompts
- 🔧 Powerful git integration
- 📝 Enhanced command editing
- 🚀 Cross-platform consistency
Star this repo if it helped you! ⭐




