GithubHelp home page GithubHelp logo

jandedobbeleer / oh-my-posh2 Goto Github PK

View Code? Open in Web Editor NEW
5.2K 85.0 281.0 541 KB

A prompt theming engine for Powershell

License: MIT License

PowerShell 100.00%
powershell theme theme-engine powershell-gallery coverage-status conemu gitter-badge paradox agnoster-theme agnoster

oh-my-posh2's Introduction

oh-my-posh

Build status Travis build status Coverage Status Gitter PS Gallery

❤ Support ❤

Patreon Liberapay Ko-Fi

Introducing V3 and what it means for V2

It's been an amazing ride for Oh myPosh, but the time has come to step it up a notch. Developers nowadays no longer stick to one shell/language, they are all tools we use to solve a certain problem. The same needs to apply to Oh my Posh. It's time to adjust to that philosophy.

That's why this version of Oh my Posh is entering maintenance mode while I'm working hard on getting V3 out of the door. Given that V3 is entirely different under the hood, it's hosted separately for now. From a user perspective, it should give the same experience out-of-the-box, with the added advantage that custom themes are a first class, no code citizen.

Install-Module oh-my-posh -Scope CurrentUser -AllowPrerelease

Documentation is also available which should give a better experience than this README has over the past few years :-)

If you're a developer looking to add functionality, please have a look at V3 to see if it already exists there. If not, feel free to create an issue or PR on V3, I will only be accepting bug fixes on V2 from now on.

Table of Contents

About

A theme engine for Powershell inspired by the work done by Chris Benti on PS-Config and Oh-My-ZSH on OSX and Linux (hence the name).

More information about why I made this can be found on my blog.

Theme

Features:

  • Easy installation
  • Awesome prompt themes for PowerShell in ConEmu
  • Git status indications (powered by posh-git)
  • Failed command indication
  • Admin indication
  • Current session indications (admin, failed command, user)
  • Configurable
  • Easily create your own theme
  • Separate settings for oh-my-posh and posh-git
  • Does not mess with the default Powershell console

Prerequisites

You should use a modern console host like ConEmu, Alacritty, Terminus, Hyper, FluentTerminal, or the official Windows Terminal to have a great terminal experience on Windows.

There are multiple ways to acquire Windows Terminal - from the Microsoft Store, the GitHub repo, or the below commandline methods:

Via WinGet (official package manager for Windows):

winget install --id=Microsoft.WindowsTerminal -e

Via Chocolatey:

choco install microsoft-windows-terminal

Via Scoop:

scoop install windows-terminal

The fonts I use are Powerline fonts, there is a great repository containing them. I use Meslo LG M Regular for Powerline Nerd Font in my ConEmu setup together with custom colors. You can find my theme here.

In case you notice weird glyphs after installing a font of choice, make sure the glyphs are available (maybe they have a different location in the font, if so, adjust the correct $ThemeSettings icon). If it turns out the character you want is not supported, select a different font.

Installation

You need to use the PowerShell Gallery to install oh-my-posh.

Install posh-git and oh-my-posh:

Install-Module posh-git -Scope CurrentUser
Install-Module oh-my-posh -Scope CurrentUser

Enable the prompt:

# Start the default settings
Set-Prompt
# Alternatively set the desired theme:
Set-Theme Agnoster

In case you're running this on PS Core, make sure to also install version 2.0.0-beta1 of PSReadLine

Install-Module -Name PSReadLine -AllowPrerelease -Scope CurrentUser -Force -SkipPublisherCheck

To enable the engine edit your PowerShell profile:

if (!(Test-Path -Path $PROFILE )) { New-Item -Type File -Path $PROFILE -Force }
notepad $PROFILE

Append the following lines to your PowerShell profile:

Import-Module posh-git
Import-Module oh-my-posh
Set-Theme Paradox

The last command sets the theme for the console. Check the available themes list below.

Configuration

List the current configuration:

$ThemeSettings

Theme

You can tweak the settings by manipulating $ThemeSettings. This example allows you to tweak the branch symbol using a unicode character:

$ThemeSettings.GitSymbols.BranchSymbol = [char]::ConvertFromUtf32(0xE0A0)

Also do not forget the Posh-Git settings itself (enable the stash indication for example):

$GitPromptSettings

Hide your username@domain when not in a virtual machine for the Agnoster, Fish, Honukai, Paradox and Sorin themes:

$DefaultUser = 'yourUsernameHere'

Helper functions

Set-Theme: set a theme from the Themes directory. If no match is found, it will not be changed. Autocomplete is available to list and complete available themes.

Set-Theme paradox

Show-ThemeColors: display the colors used by the theme

Theme

Show-Colors: display colors configured in ConEmu

Theme

Themes

Agnoster

Agnoster Theme

Paradox

Paradox Theme

Sorin

Sorin Theme

Darkblood

Darkblood Theme

Avit

Avit Theme

Honukai

Honukai Theme

Fish

Fish Theme

Robbyrussell

Robbyrussell Theme

Pararussel

Pararussel Theme

Material

Material Theme Material Theme

Star

Star Theme

Zash

Star Theme

Lambda

Lambda Theme

Emodipt

Emodipt Theme

Operator

Operator Theme

Creating your own theme

If you want to create a theme it can be done rather easily by adding a mytheme.psm1 file in the folder indicated in $ThemeSettings.MyThemesLocation (the folder defaults to ~\Documents\WindowsPowerShell\PoshThemes, feel free to change it).

The only required function is Write-Theme. You can use the following template to get started:

#requires -Version 2 -Modules posh-git

function Write-Theme
{
    param(
        [bool]
        $lastCommandFailed,
        [string]
        $with
    )

    # enter your prompt building logic here
}

$sl = $global:ThemeSettings #local settings

Feel free to use the public helper functions Get-VCSStatus, Get-VcsInfo, Get-FormattedRootLocation, Get-ShortPath, Set-CursorForRightBlockWrite, Set-CursorUp, Set-Newline or add your own logic completely.

To test the output in ConEmu, just switch to your theme:

Set-Theme mytheme

If you want to include your theme in oh-my-posh, send me a PR and I'll try to give feedback ASAP.

Happy theming!

Adding stack count to a custom theme

As it seems getting access to the stack information when using pushd/popd is sort of mission impossible from within a theme, you can use a workaround proposed by Jonathan Leech-Pepin. In your $PROFILE, add a variable that will act as a correctly scoped pointer to fetch the stack context:

$getStackContext = {Get-Location -Stack}

Next, in your custom theme, access the information you want to display:

$stackCount = (&$getStackContext).count

iTerm2 is creating notifications every time

This is caused by the ConsoleTitle functionality. As explained by Andrew Stanton-Nurse it's linked to how terminals work with OSC codes. The fix is to disable the ConsoleTitle functionality when in iTerm2 by adding the following snippet to your $PROFILE.

if($env:LC_TERMINAL -eq "iTerm2") {
    $ThemeSettings.Options.ConsoleTitle = $false
}

Based on work by

oh-my-posh2's People

Contributors

ajim3796 avatar amedee avatar eirikhoe avatar farzadmf avatar fornever avatar gilescope avatar hugo-vrijswijk avatar jandedobbeleer avatar janjoris avatar jos3s avatar krokofant avatar martinsgill avatar mrbing47 avatar mythreyak avatar pavelbraginskiy avatar quickstar avatar rashil2000 avatar rmnscnce avatar roblankey avatar rocammo avatar scottbilas avatar shenbo avatar sirjson avatar sneakysensei avatar snys98 avatar tiberriver256 avatar twilsonxpert avatar tylerleonhardt avatar vladimir-poleh avatar xbeheydt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

oh-my-posh2's Issues

The term 'Get-UserName' is not recognized as the name of a cmdlet. Darkblood theme.

I'm unable to use this gloriously awesome Darkblood theme on Win 10 and get the above error.

PowerShell Info




NameValue
PSVersion5.1.16299.98
PSEditionDesktop
PSCompatibleVersionsSystem.Version[]
BuildVersion10.0.16299.98
CLRVersion4.0.30319.42000
WSManStackVersion3.0
PSRemotingProtocolVersion2.3
SerializationVersion1.1.0.1

Module Info




NameVersion
MSI3.2.3.1024
Polaris0.1.0
PowerBIPS1.2.0.9
Get-ChildItemColor1.2.2
Microsoft.PowerShell.Operation.Validation1.0.1
oh-my-posh2.0.167
PackageManagement1.0.0.1
Pester3.4.0
posh-git0.7.1
PowerShellGet1.0.0.1
PSReadline1.2
TabExpansionPlusPlus1.2
AppBackgroundTask1.0.0.0
AppLocker2.0.0.0
AppvClient1.0.0.0
Appx2.0.0.0
AssignedAccess1.0.0.0
BitLocker1.0.0.0
BitsTransfer2.0.0.0
BranchCache1.0.0.0
CimCmdlets1.0.0.0
ConfigCI1.0
Defender1.0
DeliveryOptimization1.0.0.0
DirectAccessClientComponents1.0.0.0
Dism3.0
DnsClient1.0.0.0
EventTracingManagement1.0.0.0
International2.0.0.0
iSCSI1.0.0.0
ISE1.0.0.0
Kds1.0.0.0
Microsoft.PowerShell.Archive1.0.1.0
Microsoft.PowerShell.Diagnostics3.0.0.0
Microsoft.PowerShell.Host3.0.0.0
Microsoft.PowerShell.LocalAccounts1.0.0.0
Microsoft.PowerShell.Management3.1.0.0
Microsoft.PowerShell.ODataUtils1.0
Microsoft.PowerShell.Security3.0.0.0
Microsoft.PowerShell.Utility3.1.0.0
Microsoft.WSMan.Management3.0.0.0
MMAgent1.0
MsDtc1.0.0.0
NetAdapter2.0.0.0
NetConnection1.0.0.0
NetEventPacketCapture1.0.0.0
NetLbfo2.0.0.0
NetNat1.0.0.0
NetQos2.0.0.0
NetSecurity2.0.0.0
NetSwitchTeam1.0.0.0
NetTCPIP1.0.0.0
NetworkConnectivityStatus1.0.0.0
NetworkSwitchManager1.0.0.0
NetworkTransition1.0.0.0
PcsvDevice1.0.0.0
PKI1.0.0.0
PnpDevice1.0.0.0
PrintManagement1.1
ProcessMitigations1.0.11
Provisioning3.0
PSDesiredStateConfiguration1.1
PSDiagnostics1.0.0.0
PSScheduledJob1.1.0.0
PSWorkflow2.0.0.0
PSWorkflowUtility1.0.0.0
ScheduledTasks1.0.0.0
SecureBoot2.0.0.0
SmbShare2.0.0.0
SmbWitness2.0.0.0
StartLayout1.0.0.0
Storage2.0.0.0
TLS2.0.0.0
TroubleshootingPack1.0.0.0
TrustedPlatformModule2.0.0.0
UEV2.1.639.0
VpnClient2.0.0.0
Wdac1.0.0.0
WindowsDeveloperLicense1.0.0.0
WindowsErrorReporting1.0
WindowsSearch1.0.0.0
WindowsUpdate1.0.0.0
WindowsUpdateProvider1.0.0.2

error during update

in cmd after quitting powershell:

C:\Users\idror>powershell -noprofile -command "Update-Module oh-my-pos
h"
Module oh-my-posh was successfully updated.
Register-ArgumentCompleter : The term 'Register-ArgumentCompleter' is not
recognized as the name of a cmdlet, function, script file, or operable
program. Check the spelling of the name, or if a path was included, verify
that the path is correct and try again.
At C:\Users\idror\Documents\WindowsPowerShell\Modules\oh-my-posh\oh-m
y-posh.psm1:211 char:1
+ Register-ArgumentCompleter `
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Register-ArgumentCompleter:Stri
   ng) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : CommandNotFoundException

Import-Module : The module to process 'oh-my-posh.psm1', listed in field
'ModuleToProcess/RootModule' of module manifest 'C:\Users\idror\Docum
ents\WindowsPowerShell\Modules\oh-my-posh\oh-my-posh.psd1' was not processed
because no valid module was found in any module directory.
At C:\Users\idror\Documents\WindowsPowerShell\Modules\PsGet\PsGet.psm
1:1322 char:9
+         Import-Module -Name $ModuleBase -Global -Force:$Force
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ResourceUnavailable: (oh-my-posh:String) [Import
   -Module], PSInvalidOperationException
    + FullyQualifiedErrorId : Modules_ModuleFileNotFound,Microsoft.PowerShell.
   Commands.ImportModuleCommand

PowerShell hangs at startup due to `Start-SshAgent -Quiet`

After I install the official support for openssh from Win32-OpenSSh, PowerShell hangs at startup:

agent_start pid:9480, dbg:1, child:0, pipe:0

I thought it is caused by Win32-OpenSSH itself. It turns out to be casued by Start-SshAgent from Posh-Git.

function Start-Up
{
    # ...
    if(Get-Module -Name Posh-Git)
    {
        Start-SshAgent -Quiet
    }

    Set-Prompt
}

Everything works fine after I disable Start-SshAgent. So, maybe it is not necessary to start ssh-agent from oh-my-posh.

Remove demand for ConEmu

The current Windows 10 console is able to display powerline fonts. I just grabbed the DejaVu Sans Mono for Powerline font, installed, changed it on the console properties and it worked just fine.

image

Not every font works, even in the nerd-fonts repo. Some glyphs are not available, and some fonts don't show up on the console options menu. Actually, the only font I got to show the glyph correctly and powerline and show on options was DejaVu, but this is probably just a matter of patching the fonts correctly. The Meslo font you have on your readme does not show on console options after instalation, I guess because it is marked as a PostScript Outlines font:

image

Whereas dejavu shows as true type outlines:

image

But I am not sure if this is it.

I had to add the ConEmuANSI env var to fool oh-my-posh to believe it was in Conemu. Everything is working just fine. You could just add the instructions on how to do it, or maybe demand another env var to make sure that this is what the user wants.

Here is the end result with poweshell directly and Conemu:

image

The only strange thing so far is the yellow color which is showing up white. I will try to understand what is going on and post here later.

ConEmu Settings

Can you please update your Gist with your current shell settings for the dark them that you are using in oh-my-posh? Maybe even include that xml in the package.

thanks!

What do the icons mean

I installed this because it looked cool, but I don't understand what the icons/indicators mean (the lighting bolt and the git related indicators), is there somewhere you guys can point me to to figure this out?

Thanks!

Set-Theme doesn't work on Powershell

I've installed oh-my-posh.
When I use cmd.exe to open powershell, it works right:
image
But when I use run to open powershell, the Set-Theme doesn't work:
image
If I run cmd in powershell and then run powershell in cmd, it works:
image
Why this happens?

Rename to posh-theme

The initial idea was to create a tool like oh-my-zsh but gradually it became clear that the core functionality of this module would become theming support for PowerShell in ConEmu or cmder.

As there are other repo's out there already using the name oh-my-posh for a more oh-my-zsh like purpose, and their interest to integrate this repo in their package, it might be best to opt for a rename while it's still possible.

Food for thought.

z complains about .cdHistory on new install

If Z wasn't previously installed, on a fresh install of oh-my-posh the following error appears when launching a new shell.

Get-Content : Cannot find path 'C:\Users\nwykes.cdHistory' because it does not exist.
At C:\Users\nwykes\Documents\WindowsPowerShell\Modules\z\z.psm1:619 char:20

invoking z (like with a cd) will create the file and the complaint will go away.

Most Themes not working

I have followed the configuration steps for oh-my-posh as stated here, however most of the themes are not working:

In Agnoster, Paradox and others I only see a error symbol and the text PS, no current directory info, no git info, and no beatiful colors:

agnoster

paradox

However Darkblood, Avit and others are working:

darkblood

Avit

I don't know if it has nothing to do with it, but the themes not working are only those with background colors on path.

$env:TERM = 'msys' breaks openssh

I've began using Windows 10 OpenSSH client and quickly found that it doesn't work with oh-my-posh :(

(Inline editing breaks, arrow keys don't work in OpenSSH if I start it with oh-my-posh enabled.)

After a bit of debugging, I've found that oh-my-posh changes the TERM environment variable:

https://github.com/JanJoris/oh-my-posh/blob/14707b3c9682217f4a6733571687312c74378a0a/oh-my-posh.psm1#L21

It seems that this line breaks the OpenSSH behavior.

So, is it possible to somehow disable that line or make it optional in the future versions? For now, I'll just reset the $env:TERM to the default value after loading oh-my-posh in my PowerShell profile, but still it could cause troubles for other users.

Theme is not applied until running Show-Themes

I'm probably missing something obvious here, but the theme I configured using Set-Theme is not applied within a new terminal session until I run Show-Themes. Any ideas on what the issue may be?

Current working dir duplicated

So when I start a new PowerShell in ConEmu, I end up with the expected theme text, but also with a duplicate working directory text. Check the image below.

image

I followed the installation instructions as the Readme says and my Profile file is as follows:

Import-Module posh-git
Import-Module posh-docker
Import-Module oh-my-posh
Set-Theme honukai
$DefaultUser = 'Matheus Grieger'

No matter what theme I set, it doesn't solve the issue. What can I do?

Update
Changed theme to Darkblood. Apparently, ConEmu/Posh are ignoring line breaks:

image

The second half ([D:\Development]) should be in the second line, where the cursor is. But the inicial issue disappeared.

unreadable readme

README is in a non-standard format.

TOC links don't work.

Goes against markdown philosophy.

Could you please remove non-standard collapsing HTML elements & use standard headers?

Slow import times

I've been seeing this for a long time but oh-my-posh is very slow to import. Anyone else seeing the same behavior? It's taking 13 seconds to import in a new PS session.

Here's a snip from my profile loading log. The other two modules I explicitly import are much faster.
[00.2775] Importing PSReadline
[00.2846] Importing oh-my-posh
[13.7760] Importing z
[14.8844] Setting theme parameters

Multiline text pasting

I know this probably is not your fault, and is probably an issue of ConEmu, but I thought I would start here. Pasting multiline text in the shell seems just horrible, doesn't honor any line breaks so it of course will not run. would this be a setting of ConEmu or oh-my-posh?

Allow the addition of custom themes in a separate folder

Right now on every update of oh-my-posh, user created themes will not be available in the new version, In order to prevent this an additional folder should be allowed to contain themes that are not in the repository.

Set the folder (defaults to $HOME\.PoshThemes) using $ThemeSettings.AdditionalThemesLocation = '$HOME\.PoshThemes'.

Functions to adjust:

  • Show-Themes
  • Set-Theme
  • Set-Prompt

Do not change the way themes are currently set using $ThemeSettings.Theme = 'Agnoster' for the sake of backwards compatibility.

Restricted Characters in Imported Commands

Hi! First, I just wanted to thank you for this... I Was looking for an Oh-my-zsh approach for PowerShell since forever! but, despite I followed all install instructions that were on the readme, I still get this after importing the oh-my-posh module in my profile, also... the first to lines only adds the same first lines redundantly over and over, is this supposed to be like that?

conemu64_2018-03-06_08-20-29

That message read exactly like this in english

WARNING: Some imported command names contain one or more of the following restricted characters:
#, () {{ }} [] & - / \ $ ^; : "'<> |? @` *% + = ~

currently my profile looks like this:

if (!(Test-Path -Path $PROFILE )) { New-Item -Type File -Path $PROFILE -Force }
notepad $PROFILE
Import-Module posh-git 
Import-Module oh-my-posh

I hope its just me missing something. Thanks in advance!

Show-Themes not found error

Now that Show-Themes is removed Set-Theme generates an error if the typed theme isn't available as it tries to list the available themes.

Also, users can't list available themes either, which now requires listing the files from the module directory.

Set-Theme not working

Set-Theme : 无法将“Set-Theme”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确,然后再试一次。
(Can't recognize “Set-Theme” as a name of cmdlet, function, script, or executable program. Please check the spell, if a path is included, make sure the path is correct and try again.)
所在位置 C:\Users\zc\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1:3 字符: 1

  • Set-Theme Honukai
  •   + CategoryInfo          : ObjectNotFound: (Set-Theme:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException
    

Add Default_User option

Oh-my-zsh has the option to set a DEFAULT_USER flag. This option then hides user@hostname when logged in with that user.

# optionally set DEFAULT_USER in ~/.zshrc to your regular username to hide the “user@hostname” info when you’re logged in as yourself on your local machine.
DEFAULT_USER=user@hostname

My proposal is to have something similar in oh-my-posh to hide the username. Right now, I've edited the theme I'm using to remove the text, but this means that other users would also not show

image

Themes not sticking:

I installed according to the instructions on the main page and ran through downloading the appropriate modules, but when I type in:

$ThemeSettings

or

$GitPromptSettings

it returns nothing, and returns to prompt.

I can also set a theme, but if I log out of the interface, it doesn't stick.

I'm not sure if I skipped something but it's bizarre.

I am doing all of this in Conemu.

Breaks posh-git file completion

There should be something like this before (or after) printing the prompt.

$Global:GitStatus = Get-GitStatus

Without this, the file statuses are never updated in posh-git and so autocompletion for files (e.g. "git add ....") doesn't work.

e.g. try:

echo foo > foo
git add <TAB>

This should complete to foo automatically.

Does not start due to wrong(?) version information in oh-my-posh.psd1

When doing . $Profile after install:

Import-Module : The 'ModuleVersion' member is not valid in the module manifest file
'C:\Users\pfeiffer.stefan\Documents\WindowsPowerShell\Modules\oh-my-posh\oh-my-posh.psd1': Cannot convert value "%version%" to type "System.Version". Error: "Version
string portion was too short or too long."
At C:\Users\pfeiffer.stefan\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1:6 char:1
+ Import-Module oh-my-posh
+ ~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ResourceUnavailable: (C:\Users\pfeiff...oh-my-posh.psd1:String) [Import-Module], ArgumentException
    + FullyQualifiedErrorId : Modules_InvalidManifest,Microsoft.PowerShell.Commands.ImportModuleCommand

Using Win7, Powershell 5.0. Any ideas?

Can't get any themes to show properly

Using Powershell 5.0.10586.117 on Windows 7 x64.

I can't get any of the themes to show properly. Setting the them does seem to work (in the sense that some things change and I can't see any errors being shown), but they all look super-wonky:

image

Here's a list of my installed modules, for reference:

image

Code is not fully compatible with PSReadLine v2.0

According to an advice from PSReadLine author, I've installed PSReadLine v2.0.0-beta1 to resolve issue on PowerShell Core. After that, I see the following errors while loading my profile:

Set-PSReadLineOption : A parameter cannot be found that matches parameter name 'TokenKind'.
At E:\Projects\oh-my-posh\defaults.ps1:76 char:22
+ Set-PSReadlineOption -TokenKind Command -ForegroundColor DarkBlue
+                      ~~~~~~~~~~
+ CategoryInfo          : InvalidArgument: (:) [Set-PSReadLineOption], ParameterBindingException
+ FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.SetPSReadLineOption

Set-PSReadLineOption : A parameter cannot be found that matches parameter name 'TokenKind'.
At E:\Projects\oh-my-posh\defaults.ps1:77 char:22
+ Set-PSReadlineOption -TokenKind Parameter -ForegroundColor Yellow
+                      ~~~~~~~~~~
+ CategoryInfo          : InvalidArgument: (:) [Set-PSReadLineOption], ParameterBindingException
+ FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.SetPSReadLineOption

posh-git prompt with detached head adds to $global:error.Count

I notice that $global:error.Count constantly increases when just pressing the return key in a git versioned directory with detached head:

 ☠ Pfeiffer.Stefan@NB24  ~\…\…\…\oh-my-posh   (46908d8...) ●  $global:error.Count
53
 ☠ Pfeiffer.Stefan@NB24  ~\…\…\…\oh-my-posh   (46908d8...) ●  $global:error.Count
55
 ☠ Pfeiffer.Stefan@NB24  ~\…\…\…\oh-my-posh   (46908d8...) ●  $global:error.Count
57
 ☠ Pfeiffer.Stefan@NB24  ~\…\…\…\oh-my-posh   (46908d8...) ● 

This triggers an perpetual display of the FailedCommand-Character (skull in my case). I could not reproduce that in other git versioned directories, so i assume it has to do with the detached head. Not sure if that is an posh-git-issue...

Tab options staying highlighted

PS Version : Core 6.0 rc

When tabbing through options all previously highlighted options stay highlighted as below.

image

This happens in both ConEmu and Hyper.

Icons for different themes do not appear on newline

In themes that span multiple lines the symbols added after Set-Newline are added to the first line instead (at the end). E.g. Honukai from repository does:

# USER at MACHINE in ~ [16:54:44] ⚡ ➜

instead of:

# USER at MACHINE in ~ [16:54:44] 
⚡ ➜

This could be easily resolved by replacing:

$prompt += Set-Newline 

With

$prompt += Write-Prompt "`n"

in the theme scripts.

Set-CursorForRightBlockWrite no longer working

It seems than an update in the last few days made Set-CursorForRightBlockWrite stop working in Powershell 5 (it seems to be working okay in Powershell 6).

Powershell 5

 set-theme paradox
 me@DESKTOP-ULJFF6L  ~ [09:12:49 AM]❯
 set-theme agnoster
 me@DESKTOP-ULJFF6L  ~  set-theme paradox
 me@DESKTOP-ULJFF6L  ~ [09:12:59 AM]❯

Powershell 6

 set-theme paradox
 bdukes@DESKTOP-ULJFF6L  ~                                                                                                         [09:15:57 AM]
 ❯ set-theme agnoster
 bdukes@DESKTOP-ULJFF6L  ~  set-theme paradox
 bdukes@DESKTOP-ULJFF6L  ~                                                                                                         [09:16:02 AM]
 ❯

Installation issues?

Hello @JanJoris

First of all thank you for this! This is awesome :)

I'm having issues getting this to work and was hoping you could give me a hand. I'm very much used to working with oh-my-zh and would love to have this on Windows.

I'm using ConEmu and I've run the installation instructions:

Install-Module posh-git -Scope CurrentUser
Install-Module oh-my-posh -Scope CurrentUser

However, I'm not seeing any changes when I open powershell directly or ConEmu. $ThemeSettings doesn't return any output

image

Any suggestions?

Thanks!

Publish to the PowerShellGallery

Can you publish this to the PowerShellGallery. I don't have PsGet and the cmdlets from it interfere with the built in PackageManagment module.

thanks.

character cannot be displayed

I have installed the latest version of windows 10 and latest version of Powerline fonts, and I am using Meslo LG M for Powerline like you did in the readme.

It seems like 2 of the characters cannot be displayed:
capture

they are BranchUntrackedSymbol and BranchIdenticalStatusToSymbol what do I need to change for this to work?

Selection in autocompletion list doesn't get cleared on PowerShell Core

  1. Start new PowerShell Core session.
  2. Import-Module oh-my-posh
  3. Start autocompletion (e.g. type ./x and press TAB).
  4. Navigate through the completion list using the arrow keys.
  5. The selection doesn't gets cleared:
    image

I can't reproduce the same in Windows PowerShell on the same machine:

image

I'm using oh-my-posh version 2.0.114 installed through Install-Module oh-my-posh in both cases.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.