diff options
author | Jesse Luehrs <doy@tozt.net> | 2013-03-20 00:36:08 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2013-03-20 00:36:08 -0500 |
commit | 8fc473d033a4c38f7c0024bd259ff54b9867d50d (patch) | |
tree | 945a6323eb4d457871c7e2e26fc2684cc26ddcaa /test/termios3.rs | |
parent | 28eeecd93029db4b756844852e3608eba83bf455 (diff) | |
download | rust-term-8fc473d033a4c38f7c0024bd259ff54b9867d50d.tar.gz rust-term-8fc473d033a4c38f7c0024bd259ff54b9867d50d.zip |
implement getting terminal size
Diffstat (limited to 'test/termios3.rs')
-rw-r--r-- | test/termios3.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/test/termios3.rs b/test/termios3.rs index d051258..51f6bb2 100644 --- a/test/termios3.rs +++ b/test/termios3.rs @@ -2,7 +2,8 @@ extern mod term; fn main () { if term::ios::isatty() { - io::println("tty"); + let (rows, cols) = term::ios::size(); + io::println(fmt!("tty: %d %d", rows as int, cols as int)); } else { io::println("not tty"); |