JanDeDobbeleer / oh-my-posh2

A prompt theming engine for Powershell
MIT License
5.18k stars 281 forks source link

Wrong Windows 10 user path is being used by posh-git on git clone #300

Closed Melander closed 4 years ago

Melander commented 4 years ago

Wrong Windows 10 user path is being used by posh-git on git clone when posh-git is enabled in the Microsoft.PowerShell_profile.ps1 file.

PowerShell 7.0.3
Copyright (c) Microsoft Corporation. All rights reserved.

https://aka.ms/powershell
Type 'help' to get help.
Loading personal and system profiles took 808ms.

me@mycomputername C:\..\..\thefolder Get-InstalledModule
2.0.468     oh-my-posh      PSGallery       Theming capabilities for the PowerShell prompt in ConEmu
0.7.3       posh-git        PSGallery       Provides prompt with Git status summary information and tab completion for Git commands, parameters, remotes and branch names.

The only line inside the Microsoft.PowerShell_profile.ps1 file:

Import-Module 'posh-git'

When this row is commented out the git clone works as expected.

Expected result:

me@mycomputername C:\..\..\thefolder git clone git@gitlab.com:<url>/<ToBeCloned>.git
Cloning into 'ToBeCloned'...
remote: Enumerating objects: 565, done.
remote: Counting objects: 100% (565/565), done.
remote: Compressing objects: 100% (279/279), done.
remote: Total 4229 (delta 416), reused 412 (delta 284), pack-reused 3664
Receiving objects: 100% (4229/4229), 4.00 MiB | 2.73 MiB/s, done.
Resolving deltas: 100% (2468/2468), done.
Updating files: 100% (1401/1401), done.

Actual result:

me@mycomputername C:\..\..\thefolder git clone git@gitlab.com:<url>/<ToBeCloned>.git
Cloning into 'ToBeCloned'...
Could not create directory '/h//.ssh'.
The authenticity of host 'gitlab.com (<gitlab ip>)' can't be established.
ECDSA key fingerprint is SHA256:<fingerprint>.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Failed to add the host to the list of known hosts (/h/.ssh/known_hosts).
git@gitlab.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Melander commented 4 years ago

Wrote in the wrong browser github window