[][src]Macro crossterm_utils::execute

macro_rules! execute {
    ($write:expr, $($command:expr), *) => { ... };
}

Execute one or more command(s)

Parameters

  • std::io::Writer

    Crossterm will write the ANSI escape codes to this given. (A flush will be done)

  • Command

    Give one or more commands that you want to execute

Example

use std::io::Write;

use crossterm_utils::{execute, Output};

// will be executed directly
execute!(std::io::stdout(), Output("foo".to_string()));

// will be executed directly
execute!(std::io::stdout(), Output("foo".to_string()), Output("bar".to_string()));

Remarks

  • In the case of UNIX and windows 10, ANSI codes are written to the given 'writer'.
  • In case of Windows versions lower than 10, a direct WinApi call will be made. This is happening because Windows versions lower then 10 do not support ANSI codes, and thus they can't be written to the given buffer. Because of that there is no difference between execute and queue for those windows versions.