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

win: Add WinConsoleInfo struct #85

Merged
merged 2 commits into from Aug 20, 2018
Merged

Conversation

MoSal
Copy link
Contributor

@MoSal MoSal commented Aug 20, 2018

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: #57

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

@Stebalien Stebalien left a 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,
Copy link
Owner

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.

Copy link
Contributor Author

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?

Copy link
Owner

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.

Copy link
Contributor Author

@MoSal MoSal Aug 20, 2018

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.

Copy link
Owner

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>
@Stebalien Stebalien merged commit 3feefe8 into Stebalien:master Aug 20, 2018
@Stebalien
Copy link
Owner

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.

None yet

2 participants