My PowerShell prompt
3 min read
Today I took some time to work on my PowerShell configuration. Here is what it looks like now:
In case you already know about customizing the PowerShell, you can get the file here. If not, read on.
Shortening The Prompt
This is the default git shell prompt. As you can see, the path takes about 75% of the prompt’s width. Let’s change that.
Admittedly, until today I didn’t know a lot about PowerShell. So, after a bit research, I found an article on prompt shortening. The following two functions need to be placed into
shorten-path() takes care of shortening the path in a GVim manner and replacing the user profile path with a
prompt() is a built-in function that is used to format the prompt.
Putting It Together
While this was working, it turned out that this got rid of the branch status. Luckily, someone wrote an article about displaying git data in the prompt. I spent a good hour playing around with the code and eventually I got PowerShell to display the data again.
If you right-click on the PowerShell menu bar, you will find a menu called
Properties. In there, you can change a few things that will make your work with the PowerShell a little easier.
Here are the properties I changed:
BufferSize: 500 QuickEditMode: true Font: Lucidas Console Font Size: 14 Screen Buffer Width: 100 Screen Buffer Height: 1000 Window Width: 100 Window Height: 54