dankamongmen / growlight

notcurses block device manager / system installation tool
https://nick-black.com/dankwiki/index.php/Growlight
GNU General Public License v3.0
85 stars 12 forks source link

Running without sudo (and possibly other startup failures) lead to no output #109

Closed dankamongmen closed 3 years ago

dankamongmen commented 3 years ago

This is less than completely helpful:

[schwarzgerat](1) $  ./growlight -v
Term: 70x80 vte-256color (VTE with xterm 256-colors)

 notcurses 2.0.4 by nick black et al
  70 rows 80 cols (87.50KiB) 16B cells 256 colors+RGB
  compiled with gcc-10.2.0
  terminfo from ncurses 6.2.20200918
  avformat 58.45.100 avutil 56.51.100 swscale 5.7.100

3 renders, 404.06µs total (87.75µs min, 185.00µs max, 134.69µs avg)
3.19KiB total (130.00B min, 2.90KiB max, 1.06KiB avg)
7424.5 theoretical FPS, 0 failed renders
RGB emits:elides: def 93:97 fg 104:151 bg 9:151
 Elide rates: 51.05% 59.22% 94.38%
Cell emits:elides: 350/16450 (97.92%)
[schwarzgerat](1) $ 
xtaran commented 3 years ago

Oh, yeah, right, ran into that one, too. :-)

A nice note about that it needs to be run with root permissions instead of many lines of not (for the user) helpful babble would be nice!

dankamongmen commented 3 years ago

Resolved. We were printing the notroot failure to stderr directly, instead of using diag(). Now that we're using diag(), it is picked up by dump_diags() and printed following notcurses_stop():

[schwarzgerat](0) $  ./growlight 
Term: 70x80 vte-256color (VTE with xterm 256-colors)

 notcurses 2.0.4 by nick black et al
  70 rows 80 cols (87.50KiB) 16B cells 256 colors+RGB
  compiled with gcc-10.2.0
  terminfo from ncurses 6.2.20200918
  avformat 58.45.100 avutil 56.51.100 swscale 5.7.100

5 renders, 673.31µs total (106.43µs min, 182.13µs max, 134.66µs avg)
3.32KiB total (0.00B min, 2.90KiB max, 0.663KiB avg)
7426.0 theoretical FPS, 0 failed renders
RGB emits:elides: def 93:97 fg 106:223 bg 9:225
 Elide rates: 51.05% 67.78% 96.15%
Cell emits:elides: 424/27576 (98.49%)

Refusing to run without privileges. Use --notroot to force.
[schwarzgerat](1) $ 
dankamongmen commented 3 years ago

Works for growlight-readline, as well:

[schwarzgerat](1) $ ./growlight-readline 
Refusing to run without privileges. Use --notroot to force.
[schwarzgerat](1) $ 

This fix will be present in 1.2.20.