chore: a better PowerShell experience

This commit is contained in:
Jan De Dobbeleer 2021-11-26 12:41:33 +01:00 committed by Jan De Dobbeleer
parent 024ff06a47
commit 5256c90531
2 changed files with 15 additions and 0 deletions

View file

@ -18,6 +18,7 @@ RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get install -y --no-install-recommends \
fish \
powershell \
fzf \
&& apt-get clean
ARG USERNAME=vscode
@ -39,6 +40,12 @@ RUN mkdir /home/${USERNAME}/bin; \
# Windows or Darwin is supported someone will need to improve
# the code logic above.
# Setup a neat little PowerShell experience
RUN pwsh -Command Install-Module posh-git -Scope AllUsers -Force; \
pwsh -Command Install-Module z -Scope AllUsers -Force; \
pwsh -Command Install-Module PSFzf -Scope AllUsers -Force; \
pwsh -Command Install-Module Terminal-Icons -Scope AllUsers -Force;
# add the oh-my-posh path to the PATH variable
ENV PATH "$PATH:${USERNAME}/bin"

View file

@ -1,3 +1,11 @@
Import-Module posh-git
Import-Module PSFzf -ArgumentList 'Ctrl+t', 'Ctrl+r'
Import-Module z
Import-Module Terminal-Icons
Set-PSReadlineKeyHandler -Key Tab -Function MenuComplete
$env:POSH_GIT_ENABLED=$true
oh-my-posh --init --shell pwsh --config $env:POSH_THEME | Invoke-Expression
# NOTE: You can override the above env var from the devcontainer.json "args" under the "build" key.