Skip to content
Snippets Groups Projects
Commit bf33c16c authored by ticki's avatar ticki Committed by GitHub
Browse files

Revert "True terminal restoration"

parent 0e0b5be8
No related tags found
1 merge request!67Revert "True terminal restoration"
...@@ -54,8 +54,6 @@ pub struct RawTerminal<W: Write> { ...@@ -54,8 +54,6 @@ pub struct RawTerminal<W: Write> {
#[cfg(not(target_os = "redox"))] #[cfg(not(target_os = "redox"))]
impl<W: Write> Drop for RawTerminal<W> { impl<W: Write> Drop for RawTerminal<W> {
fn drop(&mut self) { fn drop(&mut self) {
write!(self, csi!("r")).unwrap();
write!(self, csi!("?1049l")).unwrap();
use termios::set_terminal_attr; use termios::set_terminal_attr;
set_terminal_attr(&mut self.prev_ios as *mut _); set_terminal_attr(&mut self.prev_ios as *mut _);
} }
...@@ -102,7 +100,7 @@ pub trait IntoRawMode: Write + Sized { ...@@ -102,7 +100,7 @@ pub trait IntoRawMode: Write + Sized {
impl<W: Write> IntoRawMode for W { impl<W: Write> IntoRawMode for W {
#[cfg(not(target_os = "redox"))] #[cfg(not(target_os = "redox"))]
fn into_raw_mode(mut self) -> io::Result<RawTerminal<W>> { fn into_raw_mode(self) -> io::Result<RawTerminal<W>> {
use termios::{cfmakeraw, get_terminal_attr, set_terminal_attr}; use termios::{cfmakeraw, get_terminal_attr, set_terminal_attr};
let (mut ios, exit) = get_terminal_attr(); let (mut ios, exit) = get_terminal_attr();
...@@ -118,7 +116,6 @@ impl<W: Write> IntoRawMode for W { ...@@ -118,7 +116,6 @@ impl<W: Write> IntoRawMode for W {
if set_terminal_attr(&mut ios as *mut _) != 0 { if set_terminal_attr(&mut ios as *mut _) != 0 {
Err(io::Error::new(io::ErrorKind::Other, "Unable to set Termios attribute.")) Err(io::Error::new(io::ErrorKind::Other, "Unable to set Termios attribute."))
} else { } else {
write!(self, csi!("?1049h")).unwrap();
let res = RawTerminal { let res = RawTerminal {
prev_ios: prev_ios, prev_ios: prev_ios,
output: self, output: self,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment