vercel / hyper

A terminal built on web technologies
https://hyper.is
MIT License
43.47k stars 3.52k forks source link

Cursor Starts One Space To Right When Starting From Start Menu #3307

Open dapperdandev opened 6 years ago

dapperdandev commented 6 years ago

Edits

2/13/2019

Issue

Using Hyper with the oh-my-posh agnoster-theme causes cursor displacement when run as admin. It appears the lightning bolt emoji is partly the culprit, though it renders fine in cmder or conemu. In other words, the problem appears to be the way Hyper is rendering fonts/themes since the themes render fine in other terminals.

Repro Steps

Configuration

  1. Start Powershell as Admin
  2. Install-Module posh-git
  3. Install-Module oh-my-posh
  4. code $profile
  5. Add the following code to the profile that opened:
    
    function Invoke-ConfigureShell() {
    Write-Host "Configuring Shell"
    Import-Module posh-git
    Import-Module oh-my-posh
    Set-Theme Agnoster
    }

Invoke-ConfigureShell;


### Produce Error
1. Run Hyper as Admin
2. Type and delete text anywhere in terminal

![helloworld](https://user-images.githubusercontent.com/13296622/52731338-b9216580-2f7a-11e9-8eb7-bb35dc71710a.gif)
osalinasv commented 5 years ago

I have the exact same problem with almost the same setup. In my Powershell profile script I have:

Import-Module posh-git
Import-Module oh-my-posh

Set-Theme Agnoster

Apart from the extra whitespace being added like @djbreen7 has shown, some of the unicode characters are not being rendered properly (I'm using NerdFont's patched Fira Code as the font).

image

I'm using version 3.0.0-canary.8

dapperdandev commented 5 years ago

I forgot I still had this open. I opened an issue with oh-my-posh regarding the extra whitespace: issue 127.

@osalinasv As a workaround for the cursore displacement, I edited the Agnoster theme by commenting out this code

    # ~/Documents/WindowsPowerShell/Modules/oh-my-posh/2.0.247/Themes
    # check for elevated prompt
    If (Test-Administrator) {
        $prompt += Write-Prompt -Object "$($sl.PromptSymbols.ElevatedSymbol) " -ForegroundColor $sl.Colors.AdminIconForegroundColor -BackgroundColor $sl.Colors.SessionInfoBackgroundColor
    }
Whale-fall commented 5 years ago

I have the exact same problem with almost the same setup. In my Powershell profile script I have:

Import-Module posh-git
Import-Module oh-my-posh

Set-Theme Agnoster

Apart from the extra whitespace being added like @djbreen7 has shown, some of the unicode characters are not being rendered properly (I'm using NerdFont's patched Fira Code as the font).

image

I'm using version 3.0.0-canary.8

the same issue,I can not find a way to solve it

karloluis commented 5 years ago

Any followup so far? I like my emojis 🎈