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

FailFast: The terminfo database is invalid #6132

Closed
cvandal opened this Issue Feb 7, 2018 · 30 comments

Comments

Projects
None yet
@cvandal

cvandal commented Feb 7, 2018

Steps to reproduce

pwsh

Expected behavior

Enter PowerShell without having to set the TERM env var. I could `export TERM=xterm` but this isn't picked up by VSCode and I'd prefer to leave it set to `xterm-256color`.

Actual behavior

> pwsh
PowerShell v6.0.1
Copyright (c) Microsoft Corporation. All rights reserved.

https://aka.ms/pscore6-docs
Type 'help' to get help.

FailFast: The terminfo database is invalid.

   at System.Environment.FailFast(System.String, System.Exception)
   at System.Environment.FailFast(System.String, System.Exception)
   at Microsoft.PowerShell.UnmanagedPSEntry.Start(System.String, System.String[], Int32)
   at Microsoft.PowerShell.ManagedPSEntry.Main(System.String[])
Aborted (core dumped)

Environment data

> printenv TERM
xterm-256color

> TERM=xterm pwsh
PowerShell v6.0.1
Copyright (c) Microsoft Corporation. All rights reserved.

https://aka.ms/pscore6-docs
Type 'help' to get help.

PS /home/chris> $PSVersionTable                                                                                                                       

Name                           Value                                                                                                                 
----                           -----                                                                                                                 
PSVersion                      6.0.1                                                                                                                 
PSEdition                      Core                                                                                                                  
GitCommitId                    v6.0.1                                                                                                                
OS                             Linux 4.15.0-1-default #1 SMP PREEMPT Wed Jan 31 07:03:28 UTC 2018 (ac01747)                                          
Platform                       Unix                                                                                                                  
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                                               
PSRemotingProtocolVersion      2.3                                                                                                                   
SerializationVersion           1.1.0.1                                                                                                               
WSManStackVersion              3.0                                                                                                                   
@AmandaCameron

This comment has been minimized.

AmandaCameron commented Feb 8, 2018

This is (most likely) caused by the terminfo database getting a new version in the ncurses 6.1 release. It was upgraded from 16-bit to 32-bit to allow more codes.

I noticed it the other day but ended up getting side tracked by other stuff before I filed an issue.

@SteveL-MSFT

This comment has been minimized.

Member

SteveL-MSFT commented Feb 9, 2018

Need steps to repro. unset TERM; pwsh starts without error.

@datenteiler

This comment has been minimized.

datenteiler commented Feb 14, 2018

That doesn't work well:

$ printenv TERM
xterm-256color
$ unset TERM; pwsh 
PowerShell v6.0.1
Copyright (c) Microsoft Corporation. All rights reserved.

https://aka.ms/pscore6-docs
Type 'help' to get help.

PS /home/christian> 
PS /home/christian> $                                                           
PS /home/christian> $p                                                          
PS /home/christian> $ps                                                         
PS /home/christian> $psv                                                        
PS /home/christian> $psve                                                       
PS /home/christian> $psver                                                      
PS /home/christian> $psvers                                                     
PS /home/christian> $psversi                                                    
PS /home/christian> $psversio                                                   
PS /home/christian> $psversion                                                  
PS /home/christian> $psversiont                                                                                               
PS /home/christian> $psversionta                                                
PS /home/christian> $psversiontab                                               
PS /home/christian> $psversiontabl                                              
PS /home/christian> $psversiontable   
                                          
Name                           Value                                           
----                           -----                                           
PSVersion                      6.0.1                                           
PSEdition                      Core                                            
GitCommitId                    v6.0.1                                          
OS                             Linux 4.12.14-lp150.4-default #1 SMP Fri Jan ...
Platform                       Unix                                            
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                         
PSRemotingProtocolVersion      2.3                                             
SerializationVersion           1.1.0.1                                         
WSManStackVersion              3.0                                             

Setting TERM to xterm (see cvandal) works better:

TERM=xterm pwsh

@tullo-x86

This comment has been minimized.

tullo-x86 commented Feb 20, 2018

It seems to be specific to xterm-256color, which is the default in (at least) Arch:

tully@dopamine ~ $ pwsh
PowerShell v6.0.1
Copyright (c) Microsoft Corporation. All rights reserved.

https://aka.ms/pscore6-docs
Type 'help' to get help.

FailFast: The terminfo database is invalid.

   at System.Environment.FailFast(System.String, System.Exception)
   at System.Environment.FailFast(System.String, System.Exception)
   at Microsoft.PowerShell.UnmanagedPSEntry.Start(System.String, System.String[], Int32)
   at Microsoft.PowerShell.ManagedPSEntry.Main(System.String[])
Aborted (core dumped)
tully@dopamine ~ $ printenv TERM
xterm-256color
tully@dopamine ~ $ TERM=xterm pwsh
PowerShell v6.0.1
Copyright (c) Microsoft Corporation. All rights reserved.

https://aka.ms/pscore6-docs
Type 'help' to get help.

PS /home/tully> ^D
tully@dopamine ~ $ unset TERM; pwsh
PowerShell v6.0.1
Copyright (c) Microsoft Corporation. All rights reserved.

https://aka.ms/pscore6-docs
Type 'help' to get help.

PS /home/tully> ^D
tully@dopamine ~ $ printenv TERM
tully@dopamine ~ $ pwsh
PowerShell v6.0.1
Copyright (c) Microsoft Corporation. All rights reserved.

https://aka.ms/pscore6-docs
Type 'help' to get help.

PS /home/tully> ^D
tully@dopamine ~ $ TERM=xterm-256color pwsh
PowerShell v6.0.1
Copyright (c) Microsoft Corporation. All rights reserved.

https://aka.ms/pscore6-docs
Type 'help' to get help.

FailFast: The terminfo database is invalid.

   at System.Environment.FailFast(System.String, System.Exception)
   at System.Environment.FailFast(System.String, System.Exception)
   at Microsoft.PowerShell.UnmanagedPSEntry.Start(System.String, System.String[], Int32)
   at Microsoft.PowerShell.ManagedPSEntry.Main(System.String[])
Aborted (core dumped)
tully@dopamine ~ $ 

@SteveL-MSFT SteveL-MSFT added this to the 6.1.0-Consider milestone Feb 20, 2018

@Dargmuesli

This comment has been minimized.

Dargmuesli commented Mar 7, 2018

This renders pwsh unusable on Arch in combination with VS Code. AUR/PowerShell does not even install (see comments) until TERM=xterm is set. VS Code cannot start pwsh as the default shell RC file's exports are not respected.

@swinny89

This comment has been minimized.

swinny89 commented Mar 15, 2018

xterm-256color not giving me problems on Debian Sid.

$ printenv TERM
xterm-256color
$ pwsh
PowerShell v6.0.1
Copyright (c) Microsoft Corporation. All rights reserved.

https://aka.ms/pscore6-docs
Type 'help' to get help.

PS > $psversiontable                                                

Name                           Value                                           
----                           -----                                           
PSVersion                      6.0.1                                           
PSEdition                      Core                                            
GitCommitId                    v6.0.1                                          
OS                             Linux 4.15.0-1-amd64 #1 SMP Debian 4.15.4-1 (...
Platform                       Unix                                            
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                         
PSRemotingProtocolVersion      2.3                                             
SerializationVersion           1.1.0.1                                         
WSManStackVersion              3.0   ```
@izznogooood

This comment has been minimized.

izznogooood commented Mar 16, 2018

Same issue and then some:

image

Prints new line for each input.

@znmeb

This comment has been minimized.

znmeb commented Mar 27, 2018

I have this too - also on Arch User Repository. Does anyone have it from another Linux? It might just be the Arch PKGBUILD needs some more dependencies.

Confirmed it crashes with TERM=xterm-256color and works with TERM=xterm. Same behavior for both powershell and powershell-bin from AUR.

@codywd

This comment has been minimized.

codywd commented Apr 25, 2018

Has anyone found a workaround or fix for this issue as it relates to VSCode? I can't seem to pass TERM=xterm anywhere in VS Code Settings for PowerShell, or inside the Powershell extension code. Is there anyway to pass --rcfile to VSCode before it starts bash?

I am running this on Arch Linux by the way.

@SteveL-MSFT

This comment has been minimized.

Member

SteveL-MSFT commented Apr 25, 2018

@codywd you might have better luck asking in the VSCode repo. However, vscode as a process should inherit it from the parent process.

@Dargmuesli

This comment has been minimized.

Dargmuesli commented May 3, 2018

Seems like this is fixed upstream. The next update should solve this.

@codywd

This comment has been minimized.

codywd commented May 6, 2018

@Dargmuesli Any idea when this will be merged into PowerShell? dotnet build seems to work, but running pwsh still results in this crash.

@Dargmuesli

This comment has been minimized.

Dargmuesli commented May 6, 2018

I've read Q2 2018 somewhere, but I'm not entirely sure about that. That would mean within the next 2 months.

@Dargmuesli

This comment has been minimized.

Dargmuesli commented May 6, 2018

If that's too far in the future for you, you can try and build your own version of https://raw.githubusercontent.com/instalab/DotNetCoreArch/master/PKGBUILD with the correct (preview) version.

@codywd

This comment has been minimized.

codywd commented May 6, 2018

For the sake of keeping this thread updated as well, I attempted what @Dargmuesli said, and here is my response: dotnet/corefx#26966 (comment)

@SteveL-MSFT

This comment has been minimized.

Member

SteveL-MSFT commented May 7, 2018

@codywd we just merged a change to use dotnetcore 2.1.300-rc1 which should have the fix from corefx. This will show up in PSCore6.1-Preview3 but that probably won't be until June. You can try building master branch yourself to see if it addresses the issue.

@izznogooood

This comment has been minimized.

izznogooood commented May 7, 2018

Arch AUR (git) pkg = ok 👌

@rjmholt

This comment has been minimized.

Member

rjmholt commented May 7, 2018

This looks like it's fixed in Fedora 28 too (when built from master).

@kedare

This comment has been minimized.

kedare commented May 8, 2018

From Fedora 28 I'm still having the issue (from the microsoft prod repos)

@rjmholt

This comment has been minimized.

Member

rjmholt commented May 8, 2018

@kedare The change that fixed this (which comes from an upstream fix in .NET Core) came after the latest release. So the Microsoft RPM repo won't have the fix until the next release (which I think is in about a month). But I've built from source and verified the fix on Fedora 28. (The Arch AUR package builds from our master, which is why it's fixed there)

@rjmholt

This comment has been minimized.

Member

rjmholt commented May 8, 2018

@kylesferrazza Just read your comment on the PowerShell AUR page about setting the TERM env var. Are you able to verify if this is fixed on Arch without setting TERM?

@kylesferrazza

This comment has been minimized.

Contributor

kylesferrazza commented May 8, 2018

@rjmholt I unset TERM and I am unable to reproduce the terminfo error on 6.0.2. I will remove the workaround from the PKGBUILD.

@SeriousM

This comment has been minimized.

SeriousM commented Jun 7, 2018

the powershell-bin should now work, right? I still get the error. Package version: 6.0.2-1

@rjmholt

This comment has been minimized.

Member

rjmholt commented Jun 7, 2018

@SeriousM Not with the version you're using. This will be fixed in 6.1.0-preview.3, which should be released in the next week. Arch Linux already has it because they build directly from master.

@kylesferrazza

This comment has been minimized.

Contributor

kylesferrazza commented Jun 7, 2018

@SeriousM the Arch powershell-bin package does not build from source and the issue won't be fixed until 6.1.0-preview.3 in that package

@rjmholt

This comment has been minimized.

Member

rjmholt commented Jun 7, 2018

Oh right! Yeah listen to @kylesferrazza, not me 😄

@xambroz

This comment has been minimized.

xambroz commented Jun 8, 2018

Having same problems with Powershell on Fedora 28.
With TERM=xterm-256color (which is the default for Fedora) the pwsh core-dumps:

 # export TERM=xterm-256color 
 # pwsh 
 PowerShell v6.1.0-preview.2
 Copyright (c) Microsoft Corporation. All rights reserved.

 https://aka.ms/pscore6-docs
 Type 'help' to get help.

 FailFast: The terminfo database is invalid.
 
    at System.Environment.FailFast(System.String, System.Exception)
    at System.Environment.FailFast(System.String, System.Exception)
    at Microsoft.PowerShell.UnmanagedPSEntry.Start(System.String, System.String[], Int32)
    at Microsoft.PowerShell.ManagedPSEntry.Main(System.String[])
 Aborted (core dumped)

Some info about the environment:

 # TERM=xterm pwsh 
 PowerShell v6.1.0-preview.2
 Copyright (c) Microsoft Corporation. All rights reserved.

 https://aka.ms/pscore6-docs
 Type 'help' to get help.

 PS /root> $PSVersionTable                                                                                                                                                                                          

 Name                           Value
 ----                           -----
 PSVersion                      6.1.0-preview.2
 PSEdition                      Core
 GitCommitId                    v6.1.0-preview.2
 OS                             Linux 4.16.11-300.fc28.x86_64 #1 SMP Tue May 22 18:29:09 UTC 2018
 Platform                       Unix
 PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
 PSRemotingProtocolVersion      2.3
 SerializationVersion           1.1.0.1
 WSManStackVersion              3.0
@SteveL-MSFT

This comment has been minimized.

Member

SteveL-MSFT commented Jun 8, 2018

@xambroz we believe that issue is fixed in dotnetcore2.1 which is part of Preview3 coming out "soon"

@s2p16

This comment has been minimized.

s2p16 commented Jun 10, 2018

In my Kali, according to the documentation, based on debian testing (https://docs.kali.org/policy/kali-linux-relationship-with-debian), I was experimenting the same problem with the powershell preview2 installed: need for setting the TERM var to xterm and without being able to use vs code with powershell ms extensions on.
I've installed preview3, sudo apt install powershell-preview
Then check you're over preview2:
$PSVersionTable

Name Value


PSVersion 6.1.0-preview.3
PSEdition Core
GitCommitId v6.1.0-preview.3
OS Linux 4.15.0-kali3-amd64 #1 SMP Debian 4.15.1...
Platform Unix
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
#--------------------------------------------------------------------------------
This version fixes the problem 'FailFast: The terminfo database is invalid.'

However, I'd to get around the problem the vs code powershell extensions is searching for /usr/bin/powershell executable which doesn't exists, at least installing the mentioned preview package from apt with my mentioned distribution. After fixing this problem, everything is working fine, pwsh-preview, vs-code and powershell extensions. One way it can be solved is adding a user setting with the full path to the pwsh-preview executable, in my case was:
{
// Specifies the full path to a PowerShell executable. Changes the installation of PowerShell used for language and debugging services.
"powershell.powerShellExePath": "/usr/bin/pwsh-preview"
}

@rjmholt

This comment has been minimized.

Member

rjmholt commented Jun 11, 2018

@s2p16 Thanks for reporting this -- I'm going to open an issue in the VSCode-PowerShell repo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment