Skip to content

Conversation

@richard-uk1
Copy link
Contributor

I can't get it to work for TerminfoTerm on windows (using the windows code reports the wrong values) so it is marked not supported.

Richard Dodd and others added 4 commits October 13, 2017 21:26
Also use impl Trait
I can't get it to work for TerminfoTerm (mintty)
in windows - it reports incorrect information.
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! I have a few minor changes I'd like to see but this looks good otherwise.

/// A struct representing the number of columns and rows of the terminal, and, if available, the
/// width and height of the terminal in pixels
#[derive(Debug, PartialEq, Hash, Eq, Copy, Clone, Default)]
pub struct Dims {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mind just calling this Dimensions (or Size)?

fn carriage_return(&mut self) -> Result<()>;

/// Gets the size of the terminal window, if available
fn dims(&self) -> Result<Dims>;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, I'd call this either dimensions or size. dim means something else so dims is a bit confusing.

}
}

impl From<libc::winsize> for Dims {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason to implement this? I can't see users actually needing to call this outside of term. I'd just do this conversion directly (i.e., implement a function or inline the conversion) instead of implementing From.

ti: TermInfo,
}

#[cfg(unix)]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't actually have to duplicate this entire implementation; you can just cfg out the specific function.

@@ -0,0 +1,13 @@
// An example of the avaiable functionality in term
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not entirely accurate... (to me, this implies that this is all available functionality).

@richard-uk1
Copy link
Contributor Author

Note to self: make sure to look at issue 63

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