Skip to content

saleh-rahimzadeh/GoodPrompt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GoodPrompt

A good prompt for PowerShell.

Description

A prompt with marker, path, separator bar, time, command id and command marker for ❤️ Microsoft PowerShell ❤️.

Screenshots

Interface:
Interface

Structure:
Structure

Details

  • Prompt marker: Indicating begin of a new prompt.
  • Path: Current path and address.
  • Time: Time of start of current prompt, indeed, execution time of last command.
  • Command ID: ID for new command (You can use this ID to refer to the command later or use it in TAB completion).
  • Separator bar: A bar for separating new command from previous command.
  • Command marker: Indicating begin of new command and displaying cursor, it also displays nested prompts by repeated marker.
  • Debug mode: Indicating whether is in debugging mode or not.

Installation

Simply, put content of GoodPrompt.ps1 to your PowerShell's profile and reopen PowerShell.

To create a profile, execute Create-Profile.ps1 script on your local machine.

See about_Prompts help topic for more information:

PS> Get-Help about_Prompts

Command ID

You can use Command ID and TAB completion to recall and select a command from history.
Simply, type Command ID precede '#' sign and press <TAB> key:

PS> #<command_id><TAB>

Example:

PS> #9<TAB>

You can also see history of commands and their IDs by one of following cmdlets:

PS> h
PS> history
PS> Get-History

Beside of TAB completion, you can also directly run a command in the command history by one of following cmdlets:

PS> Invoke-History <command_id>
PS> r <command_id>

Example:

PS> Invoke-History 9
PS> r 9

See about_History help topic for more information:

PS> Get-Help about_History

Dependencies

Requirment is PowerShell Core 6 and above.

To run on PowerShell 5 and below, replace `u{####} codes with $([char]0x####).
Example: "`u{2592}" replace to "$([char]0x2592)".

Another edition

There is another edition named "WellPrompt.ps1".
It is neat and has more simple interface (also better performance).

Contributing

Everyone can contribute to this project, improving the code or adding functions.

License

GoodPrompt is licensed under the MIT license.