Oh-my-posh3: Powershell -NoLogo parameter render spaces between blocks

Created on 19 Nov 2020  路  10Comments  路  Source: JanDeDobbeleer/oh-my-posh3

Prerequisites

  • [x] I have read and understand the CONTRIBUTING guide
  • [x] I looked for duplicate issues before submitting this one

Description

Using parameter "-NoLogo" with Powershell, to avoid show the startup message the windows terminal show spaces between blocks, only in the first prompt. I will add pictures to clarify this point.

The windows terminal configuration with NoLogo parameter.
image

This is an example with the error, the first line add some spaces until press enter the problem is solved
image

This is an example running from Windows Terminal without -NoLogo param (working as expected)
image

This is an example running directly from pwsh.exe with -NoLogo param setted.
Despite not displaying the fonts correctly, it does not generate the error of spaces between blocks.
image

Environment

  • Oh my Posh version: 3.38.0-beta
  • Theme: All themes tested
  • Operating System: Windows 10 Profesional (64 bits)
  • Shell: * Powershell 7.2.0-preview.1
    * Powershell 7.1.0 - (2020-11-11)
  • Terminal: Windows Terminal Preview Version: 1.5.3142.0

Steps to Reproduce

  1. Install Oh-my-posh v3 following this guide
  2. Install Windows Terminal
  3. set "-NoLogo" in powershell parameters

Expected behavior: Using -NoLogo parameter in Powershell must render the first prompt line correctly

Actual behavior: The first line is rendered with spaces between blocks

bug powershell windows

Most helpful comment

I can't reproduce this on my Mac using PowerShell... I'm waiting for a Windows machine to continue testing there. Stay tuned 馃憤馃徎

image

All 10 comments

My first reaction is: euh...wat? I do not add spaces in between in the code. I can have a look but this is most likely a Powershell issue.

Hi @JanDeDobbeleer First of all, nice work with Oh-myPosh! There were very few tools to spice up the windows terminals.
Yes, If it seems to be powershell because I just installed fluentTerminal from the store and the same thing happens here I leave a screenshot

image

I'll try to reproduce. It's not because I don't understand where this is coming from, it can't be fixed 馃槈

yes, apparently Powershell get angry when try to hide his beautifull startup text... Thank you for your support @JanDeDobbeleer !!!

I'm noticing this as well with Powershell 7.1.0

If this is rather new, I suspect the debug parameter. That's my preliminary theory for now.

I can't reproduce this on my Mac using PowerShell... I'm waiting for a Windows machine to continue testing there. Stay tuned 馃憤馃徎

image

@JanDeDobbeleer i dont know why, i think with the latest versions (3.44.0) this error not appear anymore 馃帀!
If i have any notice about it i will report here 馃憤

I'm still having this problem, even with 3.44.1. I'm not especially bothered by it (the startup message is only a marginal annoyance), but do know that this didn't happen when I tried switching oh-my-posh to v2--- so I think the problem probably has something to do with v3.

I think the problem probably has something to do with v3.

Probably, as V3 is significantly different on how it renders this. Somehow Powershell is a bit of a PITA when it comes to ANSI although the position of the space (or rather omitting of the bg color) has in theory nothing to do with ANSI.

Was this page helpful?
0 / 5 - 0 ratings