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

notcurses sample programs fail in some terminal emulators #1506

Closed
mobinmob opened this issue Apr 5, 2021 · 19 comments
Closed

notcurses sample programs fail in some terminal emulators #1506

mobinmob opened this issue Apr 5, 2021 · 19 comments
Assignees
Labels
bitmaps bitmapped graphics (sixel, kitty, mmap) bug Something isn't working
Milestone

Comments

@mobinmob
Copy link

mobinmob commented Apr 5, 2021

With version 2.2.5 in voidlinux (PR) ncneofetch, notcurses-demo, notcurses-tester do not work in xfce4-terminal - they worked in 2.2.4. I tried other terminal emulators and the result are the following:

xterm:
version=XTerm(367)
TERM=xterm
LANG=el_GR.utf8
ncneofetch works
notcurses-demo works (with issues)
notcurses-tester works (with issues)

xfce4-terminal
version=0.8.10
TERM=xterm-256color
ncneofetch does not work, just a color pallet, the command does not exit.
notcurses-demo does not work, no output, when stopped with CTRL+C the following:

 notcurses 2.2.5 by nick black et al on xterm-256color
  47 rows 94 cols (69,03KiB) 48B crend 256 colors+RGB
  compiled with gcc-10.2.1 20201203, little-endian 16B cells
  terminfo from ncurses 6.2.20200212
  avformat 58.45.100 avutil 56.51.100 swscale 5.7.100

notcurses-tester just the world map as output, nothing else, when stopped with CTRL+C the following:

===============================================================================
../src/tests/direct.cpp:4:
TEST CASE:  DirectMode
  LoadSprixel

../src/tests/direct.cpp:4: FATAL ERROR: test case CRASHED: SIGINT - Terminal interrupt signal

===============================================================================
../src/tests/direct.cpp:4:
TEST CASE:  DirectMode

DEEPEST SUBCASE STACK REACHED (DIFFERENT FROM THE CURRENT ONE):
  LoadSprixel

===============================================================================
[doctest] test cases:  12 |  11 passed | 1 failed | 35 skipped
[doctest] assertions: 365 | 365 passed | 0 failed |
[doctest] Status: FAILURE!

kitty:
version=0.19.3
TERM=xterm-kitty
ncneofetch, notcurses-demo and notcurses-tester work

alacritty:
version=0.7.2
TERM=alacritty
ncneofetch, notcurses-demo and notcurses-tester does not work,
similar failure mode as in xfce-terminal

konsole:
version=20.12.3
TERM=xterm-256color
ncneofetch, notcurses-demo and notcurses-tester work

qterminal:
version=0.16.1
TERM=xterm-256color
ncneofetch, notcurses-demo and notcurses-tester work

st:
version=0.8.4
TERM=st-256color
ncneofetch, notcurses-demo, notcurses-tester do not work,
similar failure modes to xfce4-terminal

sakura:
version=3.8.0
TERM=xterm-256color
ncneofetch, notcurses-demo, notcurses-tester do not work,
similar failure modes to xfce4-terminal

@mobinmob mobinmob added the bug Something isn't working label Apr 5, 2021
@mobinmob mobinmob changed the title notcurses programs fail in some terminal emulators notcurses sample programs fail in some terminal emulators Apr 5, 2021
@linuxergr
Copy link

linuxergr commented Apr 5, 2021

I can confirm the same phenomena on Artix Linux.
Only notcurses-tester works on xfce4-terminal
notcurses-demo runs only on qterminal

@mobinmob
Copy link
Author

mobinmob commented Apr 5, 2021

xfce4-terminal and sakura in voidlinux use vte3-0.62.1.
growlight works on all tested terminal emulators.

@dankamongmen
Copy link
Owner

thanks for the report, and sorry for not getting to this earlier -- it's been a very busy week. i'm on it.

@dankamongmen dankamongmen self-assigned this Apr 8, 2021
@dankamongmen dankamongmen added this to the 2.3.0 milestone Apr 8, 2021
@dankamongmen
Copy link
Owner

great report, btw, thorough and full of information. thanks a lot!

@dankamongmen
Copy link
Owner

so with xfce4-terminal, I always use TERM=xfce4, as noted here: https://github.com/dankamongmen/notcurses/blob/master/TERMINALS.md

let me see if i can reproduce with TERM=xterm-256color, as you indicate. it worked fine with TERM=xfce just now on Arch.

@dankamongmen
Copy link
Owner

the hang in notcurses-tester where you SIGINT suggests that it's querying for sixel support, and the terminal isn't responding. that's not keyed off of TERM, though. lemme keep digging...

@dankamongmen
Copy link
Owner

yeah, your symptoms -- ncneofetch hanging after the palette, notcurses-demo not running intro, and notcurses-tester failing in LoadSprixel -- all point at a terminal interrogation not being answered. my xfce4-terminal doesn't suffer from this problem, but i'm guessing yours does.

i just checked in some notcurses-demo diagnostics. if i'm correct, you'll see it hang after printing "Checking for bitmap support...".

OK. well, hrmm. let me see if i can build xfce4-terminal so that it hangs on an interrogation attempt. we might have to whitelist =[.

@dankamongmen
Copy link
Owner

ahhhh, i'm now reproducing the failure in xfce4-terminal, excellent.

@dankamongmen
Copy link
Owner

[grimes](0) $ ./ncneofetch 
                                                                        
                                                                        
                                                                        
                                                                        
Floating point exception (core dumped)
[grimes](136) $ 
[grimes](136) $ ./caps-rendered 

 notcurses 2.2.5 by nick black et al on vte-256color
  45 rows 80 cols (56.25KiB) 48B crend 256 colors+RGB
  compiled with gcc-10.2.0, little-endian 16B cells
  terminfo from ncurses 6.2.20200212
  avformat 58.45.100 avutil 56.51.100 swscale 5.7.100
 Colors: 256 rgb: y ccc: y setaf: y setab: y
 sgr: y sgr0: y
 op: y fgop: y bgop: y
 rows: 45 cols: 80 rpix: 0 cpix: 0 (0x0)
 max bitmap size: 0x0 colorregs: 256
 UTF8: y sextants: y braille: y images: y videos: y
 background isn't interpreted as transparent
 cup: y vpa: y hpa: y
[grimes](0) $ 

now that's odd...xfce4-terminal doesn't have bitmap support; why is it being detected?

@dankamongmen
Copy link
Owner

write(3, "\33[c", 3)                    = 3
read(3, "\33", 1)                       = 1
read(3, "[", 1)                         = 1
read(3, "?", 1)                         = 1
read(3, "6", 1)                         = 1
read(3, "5", 1)                         = 1
read(3, ";", 1)                         = 1
read(3, "1", 1)                         = 1
read(3, ";", 1)                         = 1
read(3, "9", 1)                         = 1
read(3, "c", 1)                         = 1
write(3, "\33[?80;8452h", 11)           = 11
write(3, "\33[c", 3)                    = 3
read(3, "\33", 1)                       = 1
read(3, "[", 1)                         = 1
read(3, "?", 1)                         = 1
read(3, "6", 1)                         = 1
read(3, "5", 1)                         = 1
read(3, ";", 1)                         = 1
read(3, "1", 1)                         = 1
read(3, ";", 1)                         = 1
read(3, "9", 1)                         = 1
read(3, "c", 1)                         = 1
write(3, "\33[?80;8452h", 11)           = 11

@dankamongmen
Copy link
Owner

yeah, that's wrong right there. it's going down the alacritty hack path. i'm strongly tempted to rip out same.

@dankamongmen dankamongmen added the bitmaps bitmapped graphics (sixel, kitty, mmap) label Apr 8, 2021
@dankamongmen
Copy link
Owner

i believe that i've got a fix. if there's any way y'all can verify it off master, that would be appreciated.

@dankamongmen
Copy link
Owner

yeah, this eliminates the problem on xfce4-terminal for me:

[grimes](0) $ ./caps-rendered 

 notcurses 2.2.5 by nick black et al on vte-256color
  45 rows 80 cols (56.25KiB) 48B crend 256 colors+RGB
  compiled with gcc-10.2.0, little-endian 16B cells
  terminfo from ncurses 6.2.20200212
  avformat 58.45.100 avutil 56.51.100 swscale 5.7.100
 Colors: 256 rgb: y ccc: y setaf: y setab: y
 sgr: y sgr0: y
 op: y fgop: y bgop: y
 rows: 45 cols: 80 rpix: 0 cpix: 0 (0x0)
 didn't detect bitmap graphics support   <---------------------------------- need to see this
 UTF8: y sextants: y braille: y images: y videos: y
 background isn't interpreted as transparent
 cup: y vpa: y hpa: y
[grimes](0) $ 

@dankamongmen
Copy link
Owner

Together with the change I just made for #1511, I hope and believe this to be fixed. I do, btw, suggest you use an actual vte- or xfce-prefixed TERM variable, assuming they're installed on your machine. VTE-derived terminals and xterm have many differences.

Also, are you exporting COLORTERM=24bit?

@mobinmob
Copy link
Author

mobinmob commented Apr 8, 2021

Everything works in:

  • xfce4-terminal
  • alacritty
  • sakura

st works, but has some errors in the output. Ι cannot copy them here from ncneofetch or notcurses-tester, but when running notcurses-demo I get the following:

Warning: already added escape (got 0x10000c, wanted 0x10007b)
Warning: already added escape (got 0x100009, wanted 0x10007c)
Warning: already added escape (got 0x10000b, wanted 0x10007d)
Warning: already added escape (got 0x10000a, wanted 0x10007e)

The programs run without any -visible- issues.

I also tested terminology (version=1.9.0, TERM=xterm-256color) and gnome-terminal (version=3.38.3, TERM=xterm-256color) without any problems.

@mobinmob
Copy link
Author

mobinmob commented Apr 8, 2021

Together with the change I just made for #1511, I hope and believe this to be fixed. I do, btw, suggest you use an actual vte- or xfce-prefixed TERM variable, assuming they're installed on your machine. VTE-derived terminals and xterm have many differences.

Thanx, I just used the defaults :)

Also, are you exporting COLORTERM=24bit?

I have COLORTERM=truecolor in my environment.

@dankamongmen
Copy link
Owner

Everything works in:

  • xfce4-terminal
  • alacritty
  • sakura

st works, but has some errors in the output. Ι cannot copy them here from ncneofetch or notcurses-tester, but when running notcurses-demo I get the following:

Warning: already added escape (got 0x10000c, wanted 0x10007b)
Warning: already added escape (got 0x100009, wanted 0x10007c)
Warning: already added escape (got 0x10000b, wanted 0x10007d)
Warning: already added escape (got 0x10000a, wanted 0x10007e)

The programs run without any -visible- issues.

I also tested terminology (version=1.9.0, TERM=xterm-256color) and gnome-terminal (version=3.38.3, TERM=xterm-256color) without any problems.

awesome, thanks for the invaluable testing. yeah, i'm aware of that output on st. it shouldn't cause any problems, and i keep meaning to file a bug on them. basically it means that a few special keys won't be recognized. i'm not sure whether the bug is in their terminfo files or in their code.

@dankamongmen
Copy link
Owner

as always, i appreciate the high-quality report, and your hard work on void. i always know my big red matrix of distros is going to flip green for "Void Linux" pretty much immediately after releasing, and honestly, it means a lot that someone else is looking forward to releases and making them available. thanks plenty.

@dankamongmen
Copy link
Owner

hey @mobinmob , absolutely not saying this to pressure, just letting you know 2.2.6 was released yesterday with this fix. if there are any further problems on void, let me know, and i'll get to them ASAP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bitmaps bitmapped graphics (sixel, kitty, mmap) bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants