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

Short Question to clear Screen #77

Closed
cyberpunkbln opened this issue Jan 13, 2019 · 5 comments
Closed

Short Question to clear Screen #77

cyberpunkbln opened this issue Jan 13, 2019 · 5 comments

Comments

@cyberpunkbln
Copy link

Hello,

i'm a relative new in rust and i'm hanging here at one simple solution to clear the terminal. Your solution use the winapi pure, or? No ansi escape sequence.

I have searched the whole internet:), and not find an solution why a cargo run accept ansi escapes codes and directly run of an .exe don't display the codes:).

Is it possible to easily strip down your crate to an simple code fragment where only cross clear the terminal?

thx

@TimonPost
Copy link
Member

Yes, im currently working on that. I'll will make feature flags to allow you to only have the clearing functionality of crossterm.

If you are on Windows 10 ANSI escape codes are used other windows versions are using winapi. Before you can execute ANSI escape codes on windows you have to execute on winapicall to enable this functionality.

I can link you some links later due the fact I'm on my phone now.

@cyberpunkbln
Copy link
Author

Great thx and for the links,later.

Your crate functioned very well, before i dig deep into the native GUI-Development (i'm using the gnu toolchain on windows and this make it something stranger and i search something rust pure guis and the mostly guis are wrapper for c/c++ libs/guis:)) i will test software with an terminal only user interface.

Yeah the feature feature :) sounds very good.

@TimonPost
Copy link
Member

TimonPost commented Jan 13, 2019

Nice!
So here you can find some links I use for clearing the console screen:

This is the line for clearing screen with ANSI escape codes:

Here you can find the code responsible for enabling ANSI-codes on windows.

Note that your not able to use ANSI escape codes on Windows systems < 10

@cyberpunkbln
Copy link
Author

So cool i think i better use your Crate for cross terminal functions:). Its stupid to code whatever others has coded, too.

So i close this and wait for the Feature System, then i can choose what i want, directly.

@TimonPost
Copy link
Member

Yes, that is totally true. You can just use the crate right now and when the feature flags will become available it will be easy to add them.

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

No branches or pull requests

2 participants