Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PowerShell session not started if GitLens is enabled #216

Closed
meCoding opened this issue Nov 28, 2017 · 6 comments
Closed

PowerShell session not started if GitLens is enabled #216

meCoding opened this issue Nov 28, 2017 · 6 comments
Labels
needs-more-info Needs further information, steps, details, etc.

Comments

@meCoding
Copy link

PowerShell is not starting anymore on my machine. It keeps saying "Starting PowerShell". If I disable GitLens, I can run the PowerShell. Once I enable GitLens again, PowerShell won't start. This behavior started yesterday when I updated GitLens to newest version (6.2.0). I also noticed the same on the other machine where I have VS Code and Gitlens.

Both, GitLens and PowerShell extensions are removed/reinstalled, but no difference.

  • GitLens Version: 6.2.0
  • VSCode Version: 1.18.1
  • OS Version: Windows 7 (Version 6.1.7601)
  • PS version: 5.0.10586.117
  • PowerShell extension version: 1.51

Steps to Reproduce:

  1. Enable GitLens
  2. Open a PowerShell script in editor (open a folder with PowerShell script(s))
  3. Open a Terminal window
  • On the right lower corner, "Starting PowerShell" keep displayed
  • PowerShell command prompt never opened
  1. Close the folder
  2. Disable GitLens
  3. Open a PowerShell script in editor (open a folder with PowerShell script(s))
  4. PowerShell session now opens ok
@eamodio
Copy link
Member

eamodio commented Nov 28, 2017

@meCoding Can you provides logs by setting "gitlens.outputLevel": "verbose" in your settings.json. This will enable logging to the GitLens channel in the Output pane. Once enabled, please attempt to reproduce the issue (if possible) and attach the relevant log lines from the GitLens channel. Also can you provide the output from the Powershell Extension output pane too?

I am still unable to reproduce the issue, although I am running Windows 10.

@eamodio eamodio added the needs-more-info Needs further information, steps, details, etc. label Nov 28, 2017
@meCoding
Copy link
Author

meCoding commented Nov 28, 2017

@eamodio I happend to have a virtual machine with Windows 10, VS Code and GitLens (still in version 6.1.2). I have found a difference in behavior between 6.1.2 and 6.2.0.

When you have a GitLens version 6.1.2 you don't need to "repo-enable" (git init) the folder. PowerShell is working just fine. But with GitLens version 6.2.0 you need to run "git init". Once this is done, you can open PowerShell scripts in VS Code. The same is true also in my Windows 7 machine.

Environment for verbose outputs below:

  • Windows 10
  • GitLens(v6.1.2) (later updated to 6.2.0)
  • PowerShell Extension v1.5.1
  • Visual Studio Code v1.18.1 64-bit
  • PowerShell version: 5.1.16299.64
  • Folder is NOT repo-enabled (git init)

Here is verbose output before updating GitLens:

GitLens(v6.1.2) active
Git found: 2.15.0.windows.1 @ C:\Program Files\Git\cmd\git.exe
Git version: 2.15.0.windows.1
Spawning(c:\Code): git -c core.quotepath=false -c color.ui=false rev-parse --show-toplevel
Completed(c:\Code): git -c core.quotepath=false -c color.ui=false rev-parse --show-toplevel
Spawning(c:\Code): git -c core.quotepath=false -c color.ui=false rev-parse --show-toplevel
Completed(c:\Code): git -c core.quotepath=false -c color.ui=false rev-parse --show-toplevel
1 ms to search (depth=1) for repositories in c:\Code
Spawning(c:\Code): git -c core.quotepath=false -c color.ui=false rev-parse --show-toplevel
Awaiting(c:\Code): git -c core.quotepath=false -c color.ui=false rev-parse --show-toplevel
Awaiting(c:\Code): git -c core.quotepath=false -c color.ui=false rev-parse --show-toplevel
Completed(c:\Code): git -c core.quotepath=false -c color.ui=false rev-parse --show-toplevel
Completed(c:\Code): git -c core.quotepath=false -c color.ui=false rev-parse --show-toplevel
Completed(c:\Code): git -c core.quotepath=false -c color.ui=false rev-parse --show-toplevel
getBlameForFile[Not Cached(blame)]('undefined', 'c:\Code\Test.ps1', 'undefined')
isTracked('c:\Code\Test.ps1', 'undefined', 'undefined')
Spawning(): git -c core.quotepath=false -c color.ui=false ls-files c:\Code\Test.ps1
Add blame cache for 'c:/code/test.ps1:blame'
getBlameForFile[Cached(blame)]('undefined', 'c:\Code\Test.ps1', 'undefined')
isTracked('c:\Code\Test.ps1', 'undefined', 'undefined')
Completed(): git -c core.quotepath=false -c color.ui=false ls-files c:\Code\Test.ps1
Skipping blame; 'c:\Code\Test.ps1' is not tracked
Spawning(c:\Code): git -c core.quotepath=false -c color.ui=false rev-parse --show-toplevel
Completed(c:\Code): git -c core.quotepath=false -c color.ui=false rev-parse --show-toplevel
getBlameForFile[Cached(blame)]('undefined', 'c:\Code\Test.ps1', 'undefined')
Spawning(c:\Code): git -c core.quotepath=false -c color.ui=false rev-parse --show-toplevel
Completed(c:\Code): git -c core.quotepath=false -c color.ui=false rev-parse --show-toplevel
getBlameForFile[Cached(blame)]('undefined', 'c:\Code\Test.ps1', 'undefined')

Here is verbose output after I did the update:

GitLens(v6.2.0) active
Git found: 2.15.0.windows.1 @ C:\Program Files\Git\cmd\git.exe
Git version: 2.15.0.windows.1
GitLens upgraded from v6.1.2 to v6.2.0
ShowMessage(info, 'GitLens has been updated to v6.2.0', suppressUpdateNotice, Don't Show Again)

Here is verbose output after GitLens is updated. Folder is still NOT repo-enabled (git init)

GitLens(v6.2.0) active
Git found: 2.15.0.windows.1 @ C:\Program Files\Git\cmd\git.exe
Git version: 2.15.0.windows.1
Spawning(c:\Code): git -c core.quotepath=false -c color.ui=false rev-parse --show-toplevel
Completed(c:\Code): git -c core.quotepath=false -c color.ui=false rev-parse --show-toplevel
Spawning(c:\Code): git -c core.quotepath=false -c color.ui=false rev-parse --show-toplevel
isTracked('Test.ps1', 'c:/Code', 'undefined')
Spawning(c:/Code): git -c core.quotepath=false -c color.ui=false ls-files Test.ps1
Completed(c:/Code): git -c core.quotepath=false -c color.ui=false ls-files Test.ps1
Completed(c:\Code): git -c core.quotepath=false -c color.ui=false rev-parse --show-toplevel
2 ms to search (depth=1) for repositories in c:\Code
Spawning(c:\Code): git -c core.quotepath=false -c color.ui=false rev-parse --show-toplevel
Awaiting(c:\Code): git -c core.quotepath=false -c color.ui=false rev-parse --show-toplevel
Completed(c:\Code): git -c core.quotepath=false -c color.ui=false rev-parse --show-toplevel
Completed(c:\Code): git -c core.quotepath=false -c color.ui=false rev-parse --show-toplevel
getBlameForFile[Not Cached(blame)]('undefined', 'c:\Code\Test.ps1', 'undefined')
isTracked('c:\Code\Test.ps1', 'undefined', 'undefined')
Add blame cache for 'c:/code/test.ps1:blame'
Skipping blame; 'c:\Code\Test.ps1' is not tracked

Here is verbose output after folder is repo-enabled (git init)

GitLens(v6.2.0) active
Git found: 2.15.0.windows.1 @ C:\Program Files\Git\cmd\git.exe
Git version: 2.15.0.windows.1
Spawning(c:\Code): git -c core.quotepath=false -c color.ui=false rev-parse --show-toplevel
isTracked('Test.ps1', 'c:/Code', 'undefined')
Spawning(c:/Code): git -c core.quotepath=false -c color.ui=false ls-files Test.ps1
Completed(c:\Code): git -c core.quotepath=false -c color.ui=false rev-parse --show-toplevel
Spawning(c:\Code): git -c core.quotepath=false -c color.ui=false rev-parse --show-toplevel
Completed(c:/Code): git -c core.quotepath=false -c color.ui=false ls-files Test.ps1
Completed(c:\Code): git -c core.quotepath=false -c color.ui=false rev-parse --show-toplevel
2 ms to search (depth=1) for repositories in c:\Code
Spawning(c:\Code): git -c core.quotepath=false -c color.ui=false rev-parse --show-toplevel
Completed(c:\Code): git -c core.quotepath=false -c color.ui=false rev-parse --show-toplevel
Spawning(c:/Code): git -c core.quotepath=false -c color.ui=false ls-files c:\Code\Test.ps1
Awaiting(c:/Code): git -c core.quotepath=false -c color.ui=false ls-files c:\Code\Test.ps1
getStatusForRepo('c:/Code')
Spawning(c:/Code): git -c core.quotepath=false -c color.ui=false status --porcelain=v2 --branch -u
getRemotesCore('c:/Code')
Spawning(c:/Code): git -c core.quotepath=false -c color.ui=false remote -v
Completed(c:/Code): git -c core.quotepath=false -c color.ui=false ls-files c:\Code\Test.ps1
Completed(c:/Code): git -c core.quotepath=false -c color.ui=false ls-files c:\Code\Test.ps1
Spawning(c:\Code): git -c core.quotepath=false -c color.ui=false rev-parse --show-toplevel
Awaiting(c:\Code): git -c core.quotepath=false -c color.ui=false rev-parse --show-toplevel
Completed(c:/Code): git -c core.quotepath=false -c color.ui=false status --porcelain=v2 --branch -u
getStatusForRepo('c:/Code')
Spawning(c:/Code): git -c core.quotepath=false -c color.ui=false status --porcelain=v2 --branch -u
Completed(c:/Code): git -c core.quotepath=false -c color.ui=false remote -v
getBranches('c:/Code')
Spawning(c:/Code): git -c core.quotepath=false -c color.ui=false branch -vv -a
Completed(c:\Code): git -c core.quotepath=false -c color.ui=false rev-parse --show-toplevel
Completed(c:\Code): git -c core.quotepath=false -c color.ui=false rev-parse --show-toplevel
getBlameForFile[Not Cached(blame)]('c:/Code', 'c:\Code\Test.ps1', 'undefined')
isTracked('c:\Code\Test.ps1', 'c:/Code', 'undefined')
Add blame cache for 'c:/code/test.ps1:blame'
Skipping blame; 'c:\Code\Test.ps1' is not tracked
isTracked('c:\Code\Test.ps1', 'c:/Code', 'undefined')
getBranch('c:/Code')
Spawning(c:/Code): git -c core.quotepath=false -c color.ui=false rev-parse --abbrev-ref --symbolic-full-name @ @{u}
Completed(c:/Code): git -c core.quotepath=false -c color.ui=false branch -vv -a
Completed(c:/Code): git -c core.quotepath=false -c color.ui=false status --porcelain=v2 --branch -u
Completed(c:/Code): git -c core.quotepath=false -c color.ui=false rev-parse --abbrev-ref --symbolic-full-name @ @{u}
git Error: @
fatal: ambiguous argument '@': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

Failed with exit code: 128 rev-parse --abbrev-ref --symbolic-full-name @ @{u}   cwd='c:/Code' 
  Error: @ fatal: ambiguous argument '@': unknown revision or path not in the working tree. Use '--' to separate paths from revisions, like this: 'git <command> [<revision>...] -- [<file>...]'  Failed with exit code: 128
isTracked('Test.ps1', 'c:/Code', 'undefined')

@eamodio
Copy link
Member

eamodio commented Nov 28, 2017

Can you try out the latest GitLens beta and see if it resolves the problem for you. I could never get it to reproduce, but there could have been issues where vscode wasn't protecting against exceptions/promise rejection in certain cases -- so this release might fix the issue. 🤞

@meCoding meCoding changed the title PowerShell session not started if GitLen is enabled PowerShell session not started if GitLens is enabled Nov 28, 2017
@meCoding
Copy link
Author

The beta version did the trick! Just in case I first uninstall version 6.2.0 and then install the beta version from vsix file. I did this on Windows 7 and Windows 10 machines.

Thanks @eamodio !

@meCoding
Copy link
Author

As far as I'm concerned this issue can be closed now. Next version seems to be included the fix. Thanks again @eamodio, Great job! 👍

@github-actions
Copy link

github-actions bot commented Dec 7, 2020

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs-more-info Needs further information, steps, details, etc.
Projects
None yet
Development

No branches or pull requests

2 participants