Skip to content

Does not run on OpenSUSE because of ncurses incompatibility #195

@lxscaut

Description

@lxscaut

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: gui-cs/Terminal.Gui#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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions