pub fn interact_on(&self, term: &Term) -> io::Result<bool> {
        let mut render = TermThemeRenderer::new(term, self.theme);

        render.confirm_prompt(
            &self.prompt,
            if self.show_default {
                Some(self.default)
            } else {
                None
            },
        )?;

        term.hide_cursor()?;
        term.flush()?;

        loop {
            let input = term.read_char()?;
            let rv = match input {
                'y' | 'Y' => true,
                'n' | 'N' => false,
                '\n' | '\r' => self.default,
                _ => {
                    continue;
                }
            };

            term.clear_line()?;
            render.confirm_prompt_selection(&self.prompt, rv)?;
            term.show_cursor()?;
            term.flush()?;

            return Ok(rv);
        }
    }
/// Like `interact` but allows a specific terminal to be set.
Like `interact` but allows a specific terminal to be set.
Like ` interact ` but allows a specific terminal to be set .
pub fn interact_on(&self, term: &Term) -> io::Result<bool> {
        let mut render = TermThemeRenderer::new(term, self.theme);
        render.confirm_prompt(
            &self.prompt,
            if self.show_default {
                Some(self.default)
            } else {
                None
            },
        )?;
        term.hide_cursor()?;
        term.flush()?;
        loop {
            let input = term.read_char()?;
            let rv = match input {
                'y' | 'Y' => true,
                'n' | 'N' => false,
                '\n' | '\r' => self.default,
                _ => {
                    continue;
                }
            };
            term.clear_line()?;
            render.confirm_prompt_selection(&self.prompt, rv)?;
            term.show_cursor()?;
            term.flush()?;
            return Ok(rv);
        }
    }
pub fn interact_on ( & self , term : & Term ) -> io :: Result < bool > { let mut render = TermThemeRenderer :: new ( term , self . theme ) ; render . confirm_prompt ( & self . prompt , if self . show_default { Some ( self . default ) } else { None } , ) ? ; term . hide_cursor ( ) ? ; term . flush ( ) ? ; loop { let input = term . read_char ( ) ? ; let rv = match input { 'y' | 'Y' => true , 'n' | 'N' => false , '\n' | '\r' => self . default , _ => { continue ; } } ; term . clear_line ( ) ? ; render . confirm_prompt_selection ( & self . prompt , rv ) ? ; term . show_cursor ( ) ? ; term . flush ( ) ? ; return Ok ( rv ) ; } }
Like `interact` but allows a specific terminal to be set.
Like ` interact ` but allows a specific terminal to be set .
&self
term
&Term
&self
term
&Term