Stebalien / term

A Rust library for terminfo parsing and terminal colors.
https://stebalien.github.io/doc/term/term/
Apache License 2.0
178 stars 49 forks source link

Pretend to be xterm if Windows console supports ansi #88

Closed MoSal closed 5 years ago

MoSal commented 6 years ago

Windows people seem to be fine with this: Microsoft/WSL#1446

I still think a precise terminfo file with the list of supported sequences documented in the below link would be ideal: https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences

But I didn't find such a file. And I don't know how to generate one easily.

~~A copy of xterm-256color terminfo file is included at compile-time. I copied it from ncurses 6.1.~~

~~With this commit, term should be on par with ansi_term for Windows 10 users.~~

Edited to fallback to a basic ANSI terminal.

MoSal commented 5 years ago

Can I at least get a yes/no/maybe on this one?

Stebalien commented 5 years ago

Sorry, this fell off my radar. Instead of importing the xterm definitions like this, couldn't you set the name to "xterm-256color" and then fallback on the is_ansi check in the from_name function (I'd like to avoid bundling the db if possible).

Stebalien commented 5 years ago

(please do bug me when I don't respond)

MoSal commented 5 years ago

Done. Although this is not ideal, as the fallback definition is too basic.

Stebalien commented 5 years ago

@MoSal thanks!