|
|
@ -1,5 +1,5 @@
|
|
|
|
use crate::{
|
|
|
|
use crate::{
|
|
|
|
edit::Editor,
|
|
|
|
edit,
|
|
|
|
ext::{Command, Echo, Printenv, Tail, Which},
|
|
|
|
ext::{Command, Echo, Printenv, Tail, Which},
|
|
|
|
input,
|
|
|
|
input,
|
|
|
|
log::*,
|
|
|
|
log::*,
|
|
|
@ -8,7 +8,6 @@ use crate::{
|
|
|
|
|
|
|
|
|
|
|
|
use std::{
|
|
|
|
use std::{
|
|
|
|
error::Error,
|
|
|
|
error::Error,
|
|
|
|
fmt,
|
|
|
|
|
|
|
|
io::{self, Write},
|
|
|
|
io::{self, Write},
|
|
|
|
path::{Path, PathBuf},
|
|
|
|
path::{Path, PathBuf},
|
|
|
|
};
|
|
|
|
};
|
|
|
@ -16,10 +15,12 @@ use std::{
|
|
|
|
use anyhow::Result;
|
|
|
|
use anyhow::Result;
|
|
|
|
use dirs;
|
|
|
|
use dirs;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// An interactive session. The Session object is the top-level object used to control an
|
|
|
|
|
|
|
|
/// interactive terminal session.
|
|
|
|
pub struct Session {
|
|
|
|
pub struct Session {
|
|
|
|
pub input: input::Reader,
|
|
|
|
pub input: input::Reader,
|
|
|
|
pub output: output::Writer,
|
|
|
|
pub output: output::Writer,
|
|
|
|
pub editor: Editor,
|
|
|
|
pub editor: edit::Buffer,
|
|
|
|
pub state: syntax::State,
|
|
|
|
pub state: syntax::State,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -28,7 +29,7 @@ impl Session {
|
|
|
|
Ok(Self {
|
|
|
|
Ok(Self {
|
|
|
|
input: input::Reader::new()?,
|
|
|
|
input: input::Reader::new()?,
|
|
|
|
output: output::Writer::stdout()?,
|
|
|
|
output: output::Writer::stdout()?,
|
|
|
|
editor: Editor::new(),
|
|
|
|
editor: edit::Buffer::new(),
|
|
|
|
state: syntax::State::new(),
|
|
|
|
state: syntax::State::new(),
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|