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

Interface is entirely grey #21

Open
contentfree opened this issue Jan 10, 2018 · 6 comments
Open

Interface is entirely grey #21

contentfree opened this issue Jan 10, 2018 · 6 comments
Labels
macos issues on macos theme Issues related to themes

Comments

@contentfree
Copy link

contentfree commented Jan 10, 2018

Built the latest (as of today's date) and it runs with all function except that the interface is all grey (except for the labels which appear to be black… this was with -t blue):

image

Running in iTerm 2 on macOS Sierra

@mattthias
Copy link
Owner

Hi @contentfree ,

looks like cmake couldn't detect libncurses and uses libcurses instead. The latter is missing color support. As i have no MacOS machine i'll ask a colleague tomorrow to reproduce your problem.

Just in case; I found the following in the iTerm2 FAQ (https://www.iterm2.com/faq.html):

    Q: Why is my text all black and white?
    A: The most common cause is that "minimum contrast" (under preferences > profiles > colors) is turned up all the way.

@despair86
Copy link

despair86 commented Mar 17, 2019

I'm on Solaris 2.11, having the same problem with ncurses.

Using the stock AT&T curses (which also has colour support), the labels are legible, but colours are still suppressed:
image

This is with ncurses:
image

As a reference, my build of st is perfectly capable of displaying colour (using either library):
image

@despair86
Copy link

despair86 commented Mar 17, 2019

ok found the problem (I think)

On actual UNIX systems like Solaris and macOS, /usr/include/curses.h is either BSD or AT&T curses. Here, ncurses is in /usr/include/ncurses/curses.h. Furthermore, because of this difference, CMake fails to define _HAVE_NCURSES, leading to the blank labels in fig. 1.

I do not have a macOS box to test this patch on, sorry...

diff --git a/CMakeLists.txt b/CMakeLists.txt
index c4aa7b4..2d8b6a4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -11,6 +11,20 @@ if (CURSES_HAVE_NCURSES_H)
   add_definitions(-D_HAVE_NCURSES)
 endif()

+OPTION(WITH_LED "Enable LEDs" ON)
+
+if (WITH_LED)
+  add_definitions(-DWITH_LED)
+endif()
+
+if ("{CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
+  set(LINUX TRUE)
+endif()
+
+if(UNIX OR APPLE AND NOT LINUX)
+  add_definitions(-D_HAVE_NCURSES)
+endif()
+
 set(SLURM_SOURCES slurm.c)

 # CentOS 6 / CentOS 7 only have very old cmake version where the FindCurses
diff --git a/os.h b/os.h
index a268f86..265311c 100644
--- a/os.h
+++ b/os.h
@@ -158,6 +158,8 @@
 #include <ctype.h>
 #include <signal.h>
 #include <curses.h>
+/* Uncomment if your reguler curses.h is NOT ncurses, and remove previous line */
+/* #include <ncurses/curses.h> */
 #include <ifaddrs.h>
 #include <sys/param.h>
 #include <sys/sysctl.h>
@@ -210,7 +212,7 @@
 #include <time.h>
 #include <ctype.h>
 #include <signal.h>
-#include <curses.h>
+#include <ncurses/curses.h>
 #include <sys/wait.h>
 #include <sys/stat.h>
 #include <sys/ioctl.h>

image
My local build has the background set to 0 instead of -1 because i use dtterm (and other custom colour-terminals)

@mattthias
Copy link
Owner

Thank you for the work spend on this!
I should craft a new release some when soon with a fix included.

But good to see that "Interface Speed" detection on Solaris works fine :-)

@despair86
Copy link

despair86 commented Mar 17, 2019

in retrospect, I probably should have patched the other UNIX sections, but I don't know how the other vendors package ncurses (relevant ncurses config option: --enable-overwrite gets rid of AT&T or BSD curses)

@despair86
Copy link

despair86 commented Aug 30, 2019

But good to see that "Interface Speed" detection on Solaris works fine :-)

It's broken for TUN/TAP driver
image

slurm 0.4.3+git  - http://www.github.com/mattthias/slurm/
sun-pc% ifconfig tun0
tun0: flags=10008d1<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST,IPv4> mtu 1500 index
41
        inet 10.0.0.1 --> 10.0.0.1 netmask ffff0000

Ah. Turns out the Solaris TAP driver does not export any network card kstats like it should, referring to upstream for advice.

@mattthias mattthias added the theme Issues related to themes label Sep 12, 2021
@mattthias mattthias added the macos issues on macos label Apr 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
macos issues on macos theme Issues related to themes
Projects
None yet
Development

No branches or pull requests

3 participants