Monday | 29 APR 2024
[ previous ]
[ next ]

Windows Terminal Set Up

Title:
Date: 2023-09-19
Tags:  windows, sysadmin

Windows Terminal actually became good at some point and I missed it!

My biggest issue with using wsl Ubuntu is that it takes a bit too long on start up and if I close all my sessions, that kills my vm so it has to come back up again.

Windows Terminal is fast and all I really need it to do is connect to various servers.

This will be my current set up with Windows Terminal.

The first thing is to get a Fish like experience.

Install PSReadLine:

Install-Module PSReadLine -Force

The force is to make sure we get the latest version of PSReadLine.

Next we can update the $PROFILE. First open the profile:

notepad $PROFILE

Add the following lines to the profile. If the profile is missing, you may need to create the path it throws an error about.

Import-Module PSReadLine
Set-PSReadLineOption -PredictionSource History

Set-PSReadLineKeyHandler -Chord "Ctrl+f" -Function AcceptSuggestion
Set-PSReadLineKeyHandler -Chord "Ctrl+x" -Function RevertLine

This is going to give us suggestions based on the previously used commands and also ctrl f to complete a suggestion and ctrl x to clear the command.

You may need to change the execution policy:

Set-ExecutionPolicy RemoteSigned

This should give you a Terminal that can give you suggestions and autocomplete.