Currently the "history" command in Cmder prints commands without any index associated with any command, so you can copy/paste a command or use "!!" to execute a command from the history but, unlike BASH, you can't do "!<command_index>".
"cat" has a switch, "-n", which prints line numbers of the file being printed. This, in conjunction with "history_io=3" in Clink settings (to read/write history when editing a command") works just like BASH, i.e., you can use the index printed next to a command in the history to execute that command as "!<command_index>".
Posh-Git before this release does not export `Write-VcsStatus` thus
powershell's autoloading cannot find the reqired module for the function.
note that `get-module -listAvailable` can return an array of multiple
versions.
This keeps the PROMPT variable as is and changes the prompt to the cmder style
in the clink code.
This has two advantages:
* opening a cmd in a cmder session will now show the old prompt code instead of
a ugly raw prompt without the replacements. This led to ugly output when a
batch file echoed their content (e.g `conda build recipe/`).
* when a command rewrites the prompt (e.g. an activate in a virtualenv), these
command sometimes simply overwrites the PROMPT so that the cmder enhancements
were not anymore in place. Now we simply don't care and overwrite it with our
stuff in the clink part. This might mean that a user has to install a lua
script so that e.g. conda environments are visible on the prompt.
Add a pre and post function hook around the Cmder prompt.
Specify the cmder prompt as a function that could be replaced by a user.
Write a friendly message when the user profile template is created.
Create the user profile with cmder prompt hooks ready to use.
It was concerning to run any function with a specific name every prompt
with no guarantee it remains what it was initally created as.
Core functions have been explicitly called from their
namespace like Microsoft.PowerShell.Utility\Write-Host to try and prevent
clobbering.
User supplied functions are passed in as script blocks, created as the
session runs the profile script. By creating them as constants these
function names cannot be declared again for the duration of the process.
Since the prompt function already exists by this time, set the readOnly
flag so to re-declare the prompt requires the use of -force.
It is hoped these changes limit what could be the risk of any script
redefining functions that are called automatically without user intent or
input.