【文件属性】:
文件名称:termsize-rs:获取列和行的终端大小
文件大小:5KB
文件格式:ZIP
更新时间:2021-05-10 14:29:57
Rust
术语
获取列和行的终端大小。
这个箱子提供了一个单一的函数termsize() ,该函数以行和列的形式返回终端的大小。
用法
extern crate termsize;
use termsize :: termsize;
fn main () {
match termsize () {
Some ((columns, rows)) => println! ( "Size of terminal is {} x {}" , columns, rows),
None => println! ( "Not called from a terminal" )
}
}
【文件预览】:
termsize-rs-master
----.gitignore(18B)
----src()
--------lib.rs(2KB)
----native()
--------tiocgwinsz.c(404B)
----.travis.yml(126B)
----Cargo.toml(254B)
----README.md(793B)
----tests()
--------test.rs(2KB)
----appveyor.yml(519B)
----build.rs(176B)