-
Notifications
You must be signed in to change notification settings - Fork 49
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
win: Add WinConsoleInfo struct #85
Conversation
Parallel API to terminfo terminals is also added: * WinConsoleInfo::from_env() * WinConsole::new_with_consoleinfo() Just like terminfo, this allows to check if we are going to get errors before moving `out`. Related: Stebalien#57 Signed-off-by: Mohammad AlSaleh <CE.Mohammad.AlSaleh@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
src/win.rs
Outdated
pub fn new_with_consoleinfo(out: T, consoleinfo: WinConsoleInfo) -> WinConsole<T> { | ||
WinConsole { | ||
buf: out, | ||
def_foreground: consoleinfo.def_foreground, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd modify the WinConsole
struct itself to embed a WinConsoleInfo
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right. I thought a smaller diff would be better.
Are you okay the idea behind the change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely. This brings the windows/unix interfaces closer together without breaking the API in any way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
If you ever have the time. Your feedback about term-string would be greatly appreciated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll take a look when I get a chance.
Signed-off-by: Mohammad AlSaleh <CE.Mohammad.AlSaleh@gmail.com>
Thanks! |
Parallel API to terminfo terminals is also added:
Just like terminfo, this allows to check if we are going to get
errors before moving
out
.Related: #57