You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: terminal.rs
    path of file: ./repos/nushell/src
    
    the code of the file until where you have to start completion: use std::{
    io::IsTerminal,
    sync::atomic::{AtomicI32, Ordering},
};

use nix::{
    errno::Errno,
    libc,
    sys::signal::{killpg, raise, sigaction, SaFlags, SigAction, SigHandler, SigSet, Signal},
    unistd::{self, Pid},
};

static INITIAL_PGID: AtomicI32 = AtomicI32::new(-1);

pub(crate) fn acquire(interactive: bool) {
    if interactive && std::io::s
    
pub(crate) fn acquire(interactive: bool) {
    if interactive && std::io::stdin().is_terminal() {
        // see also: https://www.gnu.org/software/libc/manual/html_node/Initializing-the-Shell.html

        if unsafe { libc::atexit(restore_terminal) } != 0 {
            eprintln!("ERROR: failed to set exit function");
            std::process::exit(1);
        };

        let initial_pgid = take_control();

        INITIAL_PGID.store(initial_pgid.into(), Ordering::Relaxed);

        unsafe {
            // SIGINT has special handling
            let ignore = SigAction::new(SigHandler::SigIgn, SaFlags::empty(), SigSet::empty());
            sigaction(Signal::SIGQUIT, &ignore).expect("signal ignore");
            sigaction(Signal::SIGTSTP, &ignore).expect("signal ignore");
            sigaction(Signal::SIGTTIN, &ignore).expect("signal ignore");
            sigaction(Signal::SIGTTOU, &ignore).expect("signal ignore");
            sigaction(
                Signal::SIGTERM,
                &SigAction::new(
                    SigHandler::Handler(sigterm_handler),
                    SaFlags::empty(),
                    SigSet::empty(),
                ),
            )
            .expect("signal action");
        }

        // Put ourselves in our own process group, if not already
        let shell_pgid = unistd::getpid();
        match unistd::setpgid(shell_pgid, shell_pgid) {
            // setpgid returns EPERM if we are the session leader (e.g., as a login shell).
            // The other cases that return EPERM cannot happen, since we gave our own pid.
            // See: setpgid(2)
            // Therefore, it is safe to ignore EPERM.
            Ok(()) | Err(Errno::EPERM) => (),
            Err(_) => {
                eprintln!("ERROR: failed to put nushell in its own process group");
                std::process::exit(1);
            }
        }
        // Set our possibly new pgid to be in control of terminal
        let _ = unistd::tcsetpgrp(libc::STDIN_FILENO, shell_pgid);
    }
}