Skip to content

DriftAsimov/better-windows-terminal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Better Windows Terminal

Are you bored of using the default windows terminal? Have no worries, we have got your back!
Special thanks to this post by Anup Aglawe! If this repo helps you, you can ⭐ it so that it can help more people!

Installing the new terminal

Using Microsoft Store (Recommended)

Open Microsoft Store and search for "Windows Terminal". In this way, your terminal will also auto-update without worrying

Using Chocolatey

You can also use Chocolatey to install the new terminal.

  • Run Get-ExecutionPolicy in Powershell. If it returns Restricted, then run Set-ExecutionPolicy AllSigned or Set-ExecutionPolicy Bypass -Scope Process.
  • Now run:
    Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager] ::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
  • This will configure chocolatey on your system. Now you can install more packages using it. We will use choco install microsoft-windows-terminal -y to install the new terminal. The -y flag is to skip all confirmation, you can remove this flag for a custom installation.

Using winget

People who are using winget can install the new terminal by running this command:

winget install --id=Microsoft.WindowsTerminal -e

Using scoop

You can also use the famous package manager scoop by running this command:

scoop bucket add extras
scoop install windows-terminal

Other methods can be found here.

Configuring your terminal

You can modify many assets of your terminal just by editing the settings.json file. Launch the terminal and then go to settings and hit "Open JSON file" located at the bottom right section. This will open settings.json in your default IDE.

  • Under profiles list, update the defaults profile to the following:

    "defaults": 
    {
        "acrylicOpacity": 0.90000000000000002,    
        "backgroundImage": "path_to_an_image",     
        "backgroundImageOpacity": 0.25,            
        "colorScheme": "Blue Matrix",  
        "experimental.retroTerminalEffect": false, 
        "fontFace": "Cascadia Code PL",           
        "fontSize": 11,                       
        "hidden": false,                  
        "useAcrylic": true     
    },

    Tip: You can even use gifs as background image.

  • Since "Blue Matrix" theme is not pre-installed, we will be adding it ourselves. Scroll down in settings.json to find a schemes list and update it like this:

    "schemes": 
    [
        {
            "background": "#1D2342",
            "black": "#101116",
            "blue": "#00B0FF",
            "brightBlack": "#686868",
            "brightBlue": "#6871FF",
            "brightCyan": "#60FDFF",
            "brightGreen": "#5FFA68",
            "brightPurple": "#D682EC",
            "brightRed": "#FF6E67",
            "brightWhite": "#FFFFFF",
            "brightYellow": "#FFFC67",
            "cursorColor": "#FFFFFF",
            "cyan": "#76C1FF",
            "foreground": "#B8FFE1",
            "green": "#00FF9C",
            "name": "Blue Matrix",
            "purple": "#D57BFF",
            "red": "#FF5680",
            "selectionBackground": "#B0DCE2",
            "white": "#C7C7C7",
            "yellow": "#FFFC58"
        },
        {}
    ]

NOTE: Since Cascadia Code PL might not be readily installed, install it from here.

More themes can be found here: https://atomcorp.github.io/themes/

Linux-like Terminal Setup

  • Install Git for windows.

  • Install Post-git and Oh-my-posh by running these scripts in Powershell:

    Install-Module posh-git -Scope CurrentUser
    Install-Module oh-my-posh -Scope CurrentUser
  • Open your Powershell profile file with nvim $PROFILE or the editor of your choice. If you don't already have a profile file then create one using this command:

    if (!(Test-Path -Path $PROFILE)) { New-Item -ItemType File -Path PROFILE -Force }
  • Now add the following to your profile file:

    Import-Module posh-git
    Import-Module oh-my-posh
    Set-PoshPrompt -Theme spaceship

    More themes can be found here.

  • If you get a module not found error then add the following code at the top of your profile file:

    $env:PSModulePath = $env:PSModulePath + "$([System.IO.Path]::PathSeparator)C:\Users\xxxx\Documents\WindowsPowerShell\Modules"

Autocompletion

Autocompletion is one of the best features of shells. We can add similar functionality to Powershell:

Set-PSReadlineKeyHandler -Key Tab -Function MenuComplete
Set-PSReadlineKeyHandler -Key UpArrow -Function HistorySearchBackward
Set-PSReadlineKeyHandler -Key DownArrow -Function HistorySearchForward

image

Just typing nv and pressing showed previous nvim $profile history and hitting Space executes that command.

image

Hitting Tab after typing emacs showed all available options.

Running Git in a new profile

The setup is very easy, you just need to install Git and then add this in your settings.json profiles dict:

{
    "commandline": "C:/Program Files/Git/bin/bash.exe --login",
    "guid": "{00000000-0000-0000-ba54-000000000002}",
    "hidden": false,
    "icon": "%PROGRAMFILES%/Git/mingw64/share/git/git-for-windows.ico",
    "name": "Git",
    "startingDirectory": null
}

If you can't figure it out in the settings.json here are the interactive settings:

image

Adding ascii arts to your terminal

You can add your own ascii art or you can use my configs which can be found here in this repo itself.

Your terminal might look like this now:

Powershell Preview

Installing neofetch

You can easily install neofetch on windows using scoop like this:

  • Install scoop if you haven't already by executing this command:

    Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')
  • Now run scoop help to check if scoop is installed correctly.

  • Before installing neofetch, you need Git installed using scoop. Run scoop install git for that.

  • After this you can run scoop install neofetch.

If everything goes well, then executing neofetch should output something like this:

Neofetch Preview

Credits

Thanks to all these sources:

You can open an issue on the repo if you face one or make a pull request if you would like to contribute.

Sneak Peak

uwu terminal