pwsh
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`.
> 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)
> 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
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.
Need steps to repro. unset TERM; pwsh
starts without error.
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
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 ~ $
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 export
s are not respected.
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 ```
Same issue and then some:
Prints new line for each input.
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.
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.
@codywd you might have better luck asking in the VSCode repo. However, vscode as a process should inherit it from the parent process.
Seems like this is fixed upstream. The next update should solve this.
@Dargmuesli Any idea when this will be merged into PowerShell? dotnet build seems to work, but running pwsh still results in this crash.
I've read Q2 2018 somewhere, but I'm not entirely sure about that. That would mean within the next 2 months.
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.
For the sake of keeping this thread updated as well, I attempted what @Dargmuesli said, and here is my response: https://github.com/dotnet/corefx/issues/26966#issuecomment-386911765
@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.
Arch AUR (git) pkg = ok 馃憣
This looks like it's fixed in Fedora 28 too (when built from master
).
From Fedora 28 I'm still having the issue (from the microsoft prod repos)
@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)
@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
?
@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.
the powershell-bin
should now work, right? I still get the error. Package version: 6.0.2-1
@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
.
@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
Oh right! Yeah listen to @kylesferrazza, not me 馃槃
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
```
@xambroz we believe that issue is fixed in dotnetcore2.1 which is part of Preview3 coming out "soon"
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"
}
@s2p16 Thanks for reporting this -- I'm going to open an issue in the VSCode-PowerShell repo
Most helpful comment
It seems to be specific to
xterm-256color
, which is the default in (at least) Arch: