Commit 31a059a9 authored by Jeremy Soller's avatar Jeremy Soller

Automatically get size of terminal

parent 1e519c75
......@@ -113,6 +113,25 @@ impl Scheme for DisplayScheme {
}
}
fn fpath(&self, id: usize, buf: &mut [u8]) -> Result<usize> {
let path_str = if id == 1 {
format!("display:input")
} else {
let console = self.console.borrow();
format!("display:{}/{}", console.w, console.h)
};
let path = path_str.as_bytes();
let mut i = 0;
while i < buf.len() && i < path.len() {
buf[i] = path[i];
i += 1;
}
Ok(i)
}
fn close(&self, _id: usize) -> Result<usize> {
Ok(0)
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment