TL;DR — Enable Emacs shortcuts (PS6 & PS7)
Open PowerShell and run this 4 lines
\> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
\> mkdir $(Split-Path $PROFILE)
\> echo "Set-PSReadLineOption -EditMode Emacs" >> $PROFILE
\> & $PROFILE
Ctrl+p to search into history to check the change was done
- Paste the
Say Hi to PowerShell
PowerShell and command line (CMD) are the default tools in windows, and you has to deal with it. Linux and Mac has a bash terminal. I know that there are another programs like Git bash, but they are not native and that is the reason that I want to focus in PowerShell.
Today PowerShell comes with the version 5 as default, it’s ok but there are some features like
&&that are really important and it doesn’t have it. So the first step is to check which version do you have and upgrade it to PowerShell7.
run this code in your terminal
Major number will shows the version. At this moment, I use the v5.1.
OK, Let’s download the latest version from github
Releases · PowerShell/PowerShell
Create your free GitHub account today to subscribe to this repository for new releases and build software alongside 50…
In the Release section, you can find all different releases, and to search it. Check the
Assets menu and find the
This is a normal installer so you won’t have any problem. Just Execute the
Powershell executable. Additionally, windows has some front-end application which integrates the program
Say Hi to «Windows Terminal»
I recommend to use this software, it is the windows terminal, this app is an interface not only for PowerShell, it works with all the terminals. Git Bash, WSL, WSL2, PowerShell, CMD and it is pretty
This app, comes in the windows store, and you can install it from the official store
Get Windows Terminal - Microsoft Store
The Windows Terminal is a modern, fast, efficient, powerful, and productive terminal application for users of…
Now that we has all the programs. lets do the configuration
Open the windows terminal
Open the Settings
Go to the
list section and copy the global unique id
guid of the PowerShell, is a long string like this. But be careful and don’t confuse with the PowerShell 5, check the comments
Now paste the value into the
defaultProfile it is located at the start of the file.
save the file and open the Windows Terminal, if everything was right, it is going to open the PowerShell
The next step is customize the configuration file. So let’s check the PowerShell Execution permissions
PowerShell restricts some customization by default. This is for security reasons. But don’t worry, it’s no dangerous and you don’t need an administration permission.
If you want to know more about this policy, the official documentation is here
about_Execution_Policies - PowerShell
Describes the PowerShell execution policies and explains how to manage them. PowerShell's execution policy is a safety…
Let’s change the
CurrentUser policy from
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Now Let’s create the scope’s folder
mkdir $(Split-Path $PROFILE)
$PROFILEis an environment variable which stores the configuration location, We are going to open this file with the
and paste the configuration
Set-PSReadLineOption -EditMode Emacs
Save it, and reload the terminal. You can close and open it or run this command
If everything goes fine. You can use the bash shortcuts in PowerShell.
C-j as Enter
I really love to Accept line with
Ctrl-j and Windows doesn’t have it. So you only need to include this line into the
Set-PSReadLineKeyHandler -Chord ctrl+j -Function AcceptLine
Here is a Webpage where you can find some awesome shortcuts to start
Basic Bash Keyboard Shortcuts
end-of-file (EOF): If there are no chars on the line, Readline returns EOF suspend: stop the program execution. fg…
Thats is all the configuration I expect this can helps you.