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

Pretend to be xterm if Windows console supports ansi #88

Merged
merged 3 commits into from
Jan 9, 2019

Conversation

MoSal
Copy link
Contributor

@MoSal MoSal commented Aug 22, 2018

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.

Signed-off-by: Mohammad AlSaleh <CE.Mohammad.AlSaleh@gmail.com>
@MoSal
Copy link
Contributor Author

MoSal commented Nov 2, 2018

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

@Stebalien
Copy link
Owner

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
Copy link
Owner

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

 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.

Signed-off-by: Mohammad AlSaleh <CE.Mohammad.AlSaleh@gmail.com>
@MoSal MoSal force-pushed the use_ansi_if_supported branch from 74ad148 to f4400b1 Compare November 3, 2018 00:32
@MoSal
Copy link
Contributor Author

MoSal commented Nov 3, 2018

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

@Stebalien Stebalien force-pushed the use_ansi_if_supported branch 6 times, most recently from 876b1ae to 67f1b94 Compare January 9, 2019 21:13
And rename to `supports_ansi`.
@Stebalien Stebalien force-pushed the use_ansi_if_supported branch from 67f1b94 to 67a1d78 Compare January 9, 2019 21:24
@Stebalien Stebalien merged commit 5e5ab5e into Stebalien:master Jan 9, 2019
@Stebalien
Copy link
Owner

@MoSal thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants