...
 
Commits (9)
eval "$(lorri direnv)"
\ No newline at end of file
This diff is collapsed.
......@@ -79,7 +79,7 @@ structopt = "0.3"
atty = "0.2"
permutate = "0.3"
xdg = "2.1"
nix = { git = "https://github.com/AdminXVII/nix", branch = "add-redox-support" }
nix = { git = "https://github.com/AdminXVII/nix", branch = "add-redox-support-bis" }
mktemp = "0.4"
# window example
......
......@@ -3,7 +3,7 @@
## Notable changes
- Arrays are full-class citizens, using the @ sigil. That means emails and git urls must be single quoted
- The shell has proper scopes (variables get unset after the end of the definition scope), and functions are closures
- The shell has an internal variable store. That means environment variables must be explicitely exported to be available to commands.
- The shell has an internal variable store. That means environment variables must be explicitly exported to be available to commands.
- For now, per-command environment variables are not supported (ex: `LANG=it_CH.utf8 man man`)
- The testing builtin (`[[ .. ]]`) was replaced with `test`, `exists`, and/or other commands
- The control flow have been revisited, see the relevant part of the manual
......
let
pkgs = import <nixpkgs> {};
in
pkgs.mkShell {
buildInputs = with pkgs; [
binutils.bintools
];
}
use super::{completer::IonCompleter, InteractiveShell};
use ion_shell::Shell;
use std::io::ErrorKind;
use nix::fcntl::{OFlag, fcntl, FcntlArg};
impl<'a> InteractiveShell<'a> {
/// Make sure to reset the fd to blocking mode
fn to_blocking(fd: std::os::unix::io::RawFd) {
fcntl(fd, FcntlArg::F_SETFL(OFlag::O_RDWR)).unwrap();
}
/// Ion's interface to Liner's `read_line` method, which handles everything related to
/// rendering, controlling, and getting input from the prompt.
pub fn readln<T: Fn(&mut Shell<'_>)>(&self, prep_for_exit: &T) -> Option<String> {
Self::to_blocking(0);
Self::to_blocking(1);
Self::to_blocking(2);
let prompt = self.prompt();
let line = self.context.borrow_mut().read_line(
prompt,
......