Skip to content

Latest commit

 

History

History
259 lines (166 loc) · 6.92 KB

File metadata and controls

259 lines (166 loc) · 6.92 KB

Deutsch English Русский

🖥️ Modern Terminal Environment on Windows

This guide walks you through setting up a modern, high-performance, and visually appealing terminal environment on Windows. It includes:

  • Windows Terminal (Preview version recommended)
  • A Nerd Font (e.g., Cascadia Code NF)
  • A modern Bash prompt via Oh My Posh

Screenshot


📦 Terminal Choice: Windows Terminal

There are many terminal options on Windows. After testing several options, I went with Windows Terminal because it's:

  • Fast
  • Modern
  • Highly configurable
  • Lightweight

I use the Preview version to access new features early.

🔧 Installation

Windows Terminal is available for free from the Microsoft Store:


🔤 Font: Nerd Font with Icon Support

To properly display icons, Git symbols, and stylish prompt elements, you'll need a Nerd Font. I recommend:

💎 Cascadia Code NF

➡️ Download on GitHub

Advantages:

  • Clear readability
  • Attractive design
  • Ligature support
  • Perfect for developer terminals

After installing, set the font as default in Windows Terminal (e.g., via settings.json).

✨ Ligature Examples

Input Display
->
=>
!=
==
===
<=

Alternatively, install a Nerd Font that fits your preferences:

➡️ Download on nerdfonts.com


⚙️ Configuring Windows Terminal

Configuration is done via the settings.json file.

📝 Steps

  1. Open the terminal.
  2. Press Ctrl + , (or access via the menu).
  3. Click on "Settings" (open JSON file).
  4. Replace or add your configuration.

In the settings.json, you can define custom SSH profiles under profiles.list[] for key-based or password-based access to remote servers.

{
    "commandline": "ssh user@server.address",
    "hidden": false,
    "icon": "\ud83d\udda5",
    "name": "My SSH Server"
}

To use a specific SSH key, just include it like this:

"commandline": "ssh -i ~/.ssh/id_ed25519 user@server.address"

👉 Generate SSH keys:

ssh-keygen -t ed25519 -C "your-comment"

👉 Using graphical applications on a remote Linux server (X11 forwarding)

If you want to use graphical applications on a remote server, it is recommended to use the XMing Server.

➡️ Download at www.straightrunning.com

After installation, the display is forwarded to the Linux system via X11 forwarding using the -X switch.

"commandline": "cmd.exe /c \"set DISPLAY=127.0.0.1:0.0&& ssh -X -i ~/.ssh/id_ed25519 user@server.adress\""

⌨️ Keybindings

Key Combination Function
Shift + ← / → Switch between Windows Terminal tabs
Alt + ← / → Switch between Tmux windows
Ctrl + ← / → Switch between NVim buffers

These settings and the color scheme are aligned with my Neovim and Tmux configurations:


🎨 True Color Support

✅ Set the TERM variable

Ensure TERM is set to xterm-256color. Add to .bashrc, .zshrc, or .profile:

export TERM=xterm-256color

🧪 Test Color Rendering

Use the truecolor-test.sh script to verify true 24-bit color support:

curl -sL https://raw.githubusercontent.com/vhstack/termpp/main/truecolor-test.sh | bash

The script renders a smooth gradient. Visible banding indicates only 256-color support; a smooth gradient indicates true color.

🖼️ Example Rendering

The 256-color version shows harsh transitions, while True Color provides a smooth gradient.

256 colors (xterm-256color with 8-bit fallback):
256 Farben Screenshot

True Color (24-bit):
True Color Screenshot


💠 Shell Prompt with Oh My Posh on a Remote Server

A modern, informative Bash prompt can make a big difference. Oh My Posh provides:

  • Git branch display
  • Exit code indicator
  • Visual separation with icons and colors

Important: Setup is on the remote server under Bash, not locally.

⚡ Quick Installation

You can automatically install the vhstack prompt theme by downloading script:

📥 Download installation script

Or directly running the following script:

curl -sL https://raw.githubusercontent.com/vhstack/termpp/main/install-termpp.sh | bash

Or with Zsh:

curl -sL https://raw.githubusercontent.com/vhstack/termpp/main/install-termpp.sh | zsh

🔧 The script will:

  • 📦 Install Oh My Posh if needed
  • 📁 Copy vhstack.omp.json to ~/.config/ohmyposh/
  • ✍️ Append the init line to your ~/.bashrc or ~/.zshrc

Tip: After installation, run source ~/.bashrc or source ~/.zshrc once – or simply restart the terminal.

🛠️ Manual Installation Oh My Posh

curl -s https://ohmyposh.dev/install.sh | bash -s

Or see the Oh My Posh Linux installation guide.


🎨 Oh My Posh Theme Configuration

Use the vhstack.omp.json theme or any other of your choice.

✅ Steps

  1. Copy vhstack.omp.json to ~/.config/ohmyposh/:

    mkdir -p ~/.config/ohmyposh
    curl -L https://raw.githubusercontent.com/vhstack/termpp/main/vhstack.omp.json -o ~/.config/ohmyposh/vhstack.omp.json
  2. Add the following to ~/.bashrc or ~/.zshrc:

    eval "$(~/.local/bin/oh-my-posh init bash --config ~/.config/ohmyposh/vhstack.omp.json)"
  3. Reload shell:

    . ~/.bashrc

Your prompt will load automatically on login.


📎 Useful Links


🎯 Final Words

This setup gives you a sleek, fast, and visually pleasing environment for daily work.

All components are modular—customize themes, fonts, keybindings, and colors.

Enjoy your new setup and happy hacking! 🚀