mirror of
https://github.com/nushell/nushell
synced 2024-12-26 13:03:07 +00:00
Add windows cfg check
This commit is contained in:
parent
3c2ac7df54
commit
c1398145f3
1 changed files with 5 additions and 1 deletions
|
@ -48,7 +48,11 @@ fn main() -> Result<(), Box<Error>> {
|
||||||
let config = Config::builder().color_mode(ColorMode::Forced).build();
|
let config = Config::builder().color_mode(ColorMode::Forced).build();
|
||||||
let h = crate::shell::Helper::new();
|
let h = crate::shell::Helper::new();
|
||||||
let mut rl: Editor<crate::shell::Helper> = Editor::with_config(config);
|
let mut rl: Editor<crate::shell::Helper> = Editor::with_config(config);
|
||||||
|
|
||||||
|
if cfg!(windows) {
|
||||||
let _ = ansi_term::enable_ansi_support();
|
let _ = ansi_term::enable_ansi_support();
|
||||||
|
}
|
||||||
|
|
||||||
rl.set_helper(Some(h));
|
rl.set_helper(Some(h));
|
||||||
if rl.load_history("history.txt").is_err() {
|
if rl.load_history("history.txt").is_err() {
|
||||||
println!("No previous history.");
|
println!("No previous history.");
|
||||||
|
|
Loading…
Reference in a new issue