vercel / hyper

A terminal built on web technologies
https://hyper.is
MIT License
43.45k stars 3.52k forks source link

consider implementing XTVERSION #5940

Open dankamongmen opened 3 years ago

dankamongmen commented 3 years ago

Is your feature request related to a problem? Please describe. I'd like a reliable way to identify Hyper and its version from within the terminal. I see that Hyper already implements Device Attributes 1 and 2. It would be great if it could implement XTVERSION for an unambiguous signal, especially since Hyper recommends an ambiguous TERM value of xterm-256color.

Describe the solution you'd like XTerm and numerous other terminals support XTVERSION. From the Xterm Control Sequences document:

CSI > Ps q Ps = 0 ⇒ Report xterm name and version (XTVERSION). The response is a DSR sequence identifying the version: DCS > | text ST

Notcurses uses this for fine-grained terminal identification.

Describe alternatives you've considered I see that Hyper 3.1.3 on Debian is reporting 276 for DA2:

control_read:1702:read 11 from 0                                                                                                                
pump_control_read:1262:state:  0 char:    27 1b                                                                                                 
pump_control_read:1262:state:  1 char: [  91 5b                                                                                                 
pump_control_read:1262:state:  2 char: >  62 3e                                                                                                 
pump_control_read:1262:state: 21 char: 0  48 30                                                                                                 
pump_control_read:1262:state: 21 char: ;  59 3b                                                                                                 
pump_control_read:1262:state: 22 char: 2  50 32                                                                                                 
pump_control_read:1262:state: 22 char: 7  55 37                                                                                                 
pump_control_read:1262:state: 22 char: 6  54 36                                                                                                 
pump_control_read:1262:state: 22 char: ;  59 3b                                                                                                 
pump_control_read:1546:Got DA2 Pv: 276      

This is ambiguous, even if 3.1.3 can be extracted from it.

Additional context I use fine-grained terminal information both for heuristics/workarounds where absolutely necessary, and also just as an informative element. It also helps with bug reports sometimes, since the terminal+version are unambiguously present in the bug report. For instance, here's notcurses-info running on Kitty 0.23.1:

2021-09-13-163345_806x633_scrot

thanks!

dankamongmen commented 3 years ago

here's the same on hyper 3.1.3 2021-09-13-163537_726x626_scrot

dankamongmen commented 3 years ago

at a minimum, if i can identify Hyper, i can credit it with good support for Unicode quadrant characters, and thus enable NCBLIT_2x2. looking at the notcurses-info output above, it seems like your Unicode sextants are a bit messy. you might want to consider drawing those yourselves, rather than relying on the font.

Hyper has otherwise been a pleasure to experiment with. good job! notcurses-demo runs well right off the bat, something of a rarity.