A PowerShell module that provides a graphical Command History activated by the F7
and Shift-F7
keys.
Install F7History
from the PowerShell Gallery.
Install-Module -Name "F7History"
Add a line to import F7History
in your PowerShell $profile
:
Import-Module -Name "F7History"
To change the key bindings, use the -ArgumentList
parameter when importing the module. For example, to use F6
and Shift-F6
instead of F7
and Shift-F7
:
Import-Module -Name "F7History" -ArgumentList @{Key = "F6"; AllKey = "Shift-F6"}
At the PowerShell command line:
- Press
F7
to see the history for the current PowerShell instance. - Press
Shift-F7
to see the history for all PowerShell instances.
Whatever was typed on the command line before hitting F7
or Shift-F7
will be used for the Out-ConsoleGridView
`-Filter`` parameter.
When the Command Line History
window is displayed:
- Use the arrow keys or mouse to select an item.
- Use
ENTER
to insert the selected item on the command line. - Use
ESC
to close the window without inserting anything on the command line.
Terminal.Gui, upon which F7History is built, has an abstraction layer for OS and terminal platforms called ConsoleDrivers
.CursesDriver
is the default for Linux and macOS. On Windows, the default is WindowsDriver
. NetDriver
is a pure .NET implementation that works on all platforms (but is not as fast or full-featured as the platform-specific drivers).
To force F7History to use NetDriver
, set the $F7UseNetDriver
variable to $true
in your PowerShell session. When $F7UseNetDriver
is set to $true
, F7History will display NetDriver
on the status bar.
To enable diagnostics information, set the $F7EnableDiagnostics
variable to $true
in your PowerShell session. This will cause F7History to display version information in the status bar and sets both the -Debug
and -Verbose
parameters for Out-ConsoleGridView
.
This module is dependent on these modules which will automatically be installed if they are not already present:
To build locally:
.\build.ps1
This will create the ./Output/F7History
folder containing the module, build the module, publish it to a local repository (-Repository -local
), and import it into the current PowerShell session. To create the local repository, run this command:
Register-PSRepository -Name local -SourceLocation "~/psrepo" -InstallationPolicy Trusted
We use MainLine Development
. See https://gitversion.net/docs/reference/modes/mainline
The module is published to the PowerShell Gallery using GitHub Actions. See the publish.yml GitHub Action for details.
Merge changes to the main
branch, or push directly to main
. The GitHub Action will build and publish the module to the PowerShell Gallery here: https://www.powershellgallery.com/packages/F7History
To increment the minor version ensure the merge message includes "+semver: minor". To increment the major version ensure the merge message includes "+semver: major". See https://gitversion.net/docs/reference/version-increments
Thanks goes to these wonderful people (emoji key):
Tig 🚧 🚇 👀 |
This project follows the all-contributors specification. Contributions of any kind welcome!