GraphicalTools: Does not run on OpenSUSE because of ncurses incompatibility
Prerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest version
- Search the existing issues.
Steps to reproduce
When running Out-ConsoleGridview on OpenSUSE Tumbleweed (latest version) I get the following error:
Out-ConsoleGridView: Curses failed to initialize, the exception is: The native method "COLOR_PAIRS" does not exist
Checking the symbols of libncursesw.so.6 reveals the following issue:
> nm -D /lib64/libncursesw.so.6 | grep COLOR 000000000000f3e0 T COLOR_PAIR 000000000000d740 T _nc_COLOR_PAIRS 000000000000d760 T _nc_COLORS
With ncurses5 on OpenSUSE it would work as on most other Linux distros:
> nm -D /lib64/libncursesw.so.5 | grep COLOR 000000000000eeb0 T COLOR_PAIR 0000000000034034 B COLOR_PAIRS 0000000000034030 B COLORS
However OpenSUSE relies on ncurses6 and I cannot get pwsh running with libncursesw.so.5 and so Out-ConsoleGridView doesn’t work on this Linux distribution.
Already updated ncurses to the latest available package version:
ncurses-utils-6.4.20230617-15.1.x86_64 ncurses-devel-6.4.20230617-15.1.x86_64 libncurses6-6.4.20230617-15.1.x86_64
A few potential fixes such as trying to load _nc_COLOR_PAIRS if available instead of COLOR_PAIRS or others are described here: https://github.com/gui-cs/Terminal.Gui/issues/415
I hope you can help us here, as a change in this package is more likely than getting an update from the OpenSUSE distro.
Thanks and best regards, Alex
Expected behavior
Out-ConsoleGridview works
Actual behavior
PS > Get-Process | Out-ConsoleGridView
Out-ConsoleGridView: Curses failed to initialize, the exception is: The native method "COLOR_PAIRS" does not exist
Error details
PS > Get-Error
Exception :
Type : System.Exception
TargetSite :
Name : Init
DeclaringType : Terminal.Gui.CursesDriver, Terminal.Gui, Version=1.7.2.0, Culture=neutral, PublicKeyToken=null
MemberType : Method
Module : Terminal.Gui.dll
Message : Curses failed to initialize, the exception is: The native method "COLOR_PAIRS" does not exist
Source : Terminal.Gui
HResult : -2146233088
StackTrace :
at Terminal.Gui.CursesDriver.Init(Action terminalResized)
at Terminal.Gui.Application.Init(Func`1 topLevelFactory, ConsoleDriver driver, IMainLoopDriver mainLoopDriver)
at Terminal.Gui.Application.Init(ConsoleDriver driver, IMainLoopDriver mainLoopDriver)
at OutGridView.Cmdlet.ConsoleGui.Start(ApplicationData applicationData) in D:\a\_work\1\s\src\Microsoft.PowerShell.ConsoleGuiTools\ConsoleGui.cs:line 31
at OutGridView.Cmdlet.OutConsoleGridViewCmdletCommand.EndProcessing() in D:\a\_work\1\s\src\Microsoft.PowerShell.ConsoleGuiTools\OutConsoleGridviewCmdletCommand.cs:line 147
at System.Management.Automation.CommandProcessorBase.Complete()
CategoryInfo : NotSpecified: (:) [Out-ConsoleGridView], Exception
FullyQualifiedErrorId : System.Exception,OutGridView.Cmdlet.OutConsoleGridViewCmdletCommand
InvocationInfo :
MyCommand : Out-ConsoleGridView
ScriptLineNumber : 1
OffsetInLine : 15
HistoryId : 2
Line : Get-Process | Out-ConsoleGridView
Statement : Out-ConsoleGridView
PositionMessage : At line:1 char:15
+ Get-Process | Out-ConsoleGridView
+ ~~~~~~~~~~~~~~~~~~~
InvocationName : Out-ConsoleGridView
CommandOrigin : Internal
ScriptStackTrace : at <ScriptBlock>, <No file>: line 1
Environment data
PS > $PSVersionTable
Name Value
---- -----
PSVersion 7.4.0-preview.4
PSEdition Core
GitCommitId 7.4.0-preview.4
OS openSUSE Tumbleweed
Platform Unix
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Version
0.7.2
Visuals
No response
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 20
after also copying file lib/netstandard2.0/NStack.dll from packlage nstack.core.1.0.7.nupkg to ~/.local/share/powershell/Modules/Microsoft.PowerShell.ConsoleGuiTools/0.7.2 it seems to work now!
😄
thanks a lot! this is great!
of course, this would be a much nicer approach…
yes, i know. that’s why i am looking forward to receive your fix… 😉
thanks. i am waiting for info when your PR is merged and how i can install it.
You welcome. Even if you already have installed libncurses5 it doesn’t work without the fix. I hope @tig understand the inconvenience that OpenSuse users are facing and can publish this fix as quickly as possible. I’m not very familiar with PowerShell and maybe someone else can answer what’s the right declaration.
hi,
no. first, my colleague created the issue for me. but as i anyhow also have a github account, i can answer your questions myself.