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