Skip to content

Instantly share code, notes, and snippets.

@ghorsey
Last active June 30, 2022 01:13
Show Gist options
  • Save ghorsey/172461a607ac80802f4f8d009a9f3b4c to your computer and use it in GitHub Desktop.
Save ghorsey/172461a607ac80802f4f8d009a9f3b4c to your computer and use it in GitHub Desktop.

Setup Fancy Prompt

Instructions taken from: https://www.thecloudadmin.eu/post/2020-0101-windowsterminal/ for configuring windows terminal Instructions taken from: https://windowsloop.com/add-open-windows-terminal-here-option-to-right-click-menu to configure Open Here in Explorer. Oh my posh has been updated to no longer use the powershell module... https://ohmyposh.dev/docs/installation/windows

Powershell

  1. Windows Terminal from the Microsoft Store
  2. Run the following commands:
Install-Module posh-git -Scope CurrentUser -Force
Install-Module oh-my-posh -Scope CurrentUser -Force
Install-Module -Name PSReadLine -Scope CurrentUser -Force -SkipPublisherCheck
  1. To Update: Update-Module -Name oh-my-posh
  2. Update $profile
if (!(Test-Path -Path $PROFILE )) { New-Item -Type File -Path $PROFILE -Force }
notepad $PROFILE
  1. With the following content:
Import-Module posh-git
Import-Module oh-my-posh
Set-PoshPrompt -Theme blueish

For Powershell 7

Import-Module posh-git
oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH\blueish.omp.json" | Invoke-Expression

Ubuntu

  1. Install the following:

    sudo apt install golang-go
    go get -u github.com/justjanne/powerline-go
    
  2. Update your ~/.bashrc:

    GOPATH=$HOME/go
    function _update_ps1() {
        PS1="$($GOPATH/bin/powerline-go -error $?)"
    }
    if [ "$TERM" != "linux" ] && [ -f "$GOPATH/bin/powerline-go" ]; then
        PROMPT_COMMAND="_update_ps1; $PROMPT_COMMAND"
    fi
    

Install and Set Font

  1. Run the following command to install font:

    choco install cascadiacode
    choco install cascadiamono
    choco install cascadiacodepl
    choco install cascadiamonopl
    
  2. Set fontFace in settings of Windows Terminal to Cascadia Code PL

  3. Update Visual Studio Code Settings:

    "git.enableSmartCommit": true,
    "git.confirmSync": false,
    "editor.accessibilitySupport": "off",
    "editor.fontFamily": "'Cascadia Code PL', Consolas, 'Courier New', monospace",
    "editor.fontLigatures": true,
    "terminal.integrated.fontFamily": "'Cascadia Code PL'",
    "terminal.integrated.shell.windows": "C:\\Program Files\\PowerShell\\6\\pwsh.exe"
    

Add Right-Click Open Here

  1. Update Windows Terminal Settings by setting: "startingDirectory": "."

  2. Create a text file named openHere.reg

  3. Edit the text file with the following values (Be sure to set your correct <UserName>):

    Windows Registry Editor Version 5.00
    
    [HKEY_CLASSES_ROOT\Directory\Background\shell\wt]
    @="Open Windows Terminal here"
    
    [HKEY_CLASSES_ROOT\Directory\Background\shell\wt\command]
    @="C:\\Users\\<UserName>\\AppData\\Local\\Microsoft\\WindowsApps\\wt.exe"
    
  4. Double click on openHere.reg to add it to windows registery.

Add Windows Terminal Icon to Right-Click Menu:

  1. Create the directory %USERPROFILE%/AppData/Local/WTerminal.
  2. Download offical icon into the new WTerminal directory named terminal.ico.
  3. Open "Registery Editor".
  4. Navigate to the HKEY_CLASSES_ROOT\Directory\Background\shell\wt key.
  5. Create a new String Value with the name Icon and the value set to the path %USERPROFILE%/AppData/Local/WTerminal/terminal.ico
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment