From 6acc486e00f0338ea7c19e1967a23b0c6557546b Mon Sep 17 00:00:00 2001 From: Stephen Chung Date: Wed, 9 Feb 2022 08:39:33 +0800 Subject: [PATCH] Revise keys for Windows vs Unix --- src/bin/rhai-repl.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/bin/rhai-repl.rs b/src/bin/rhai-repl.rs index 41083cad..a9c775e6 100644 --- a/src/bin/rhai-repl.rs +++ b/src/bin/rhai-repl.rs @@ -85,6 +85,7 @@ fn print_keys() { println!("Ctrl-R => reverse search history"); println!(" (Ctrl-S forward, Ctrl-G cancel)"); println!("Ctrl-L => clear screen"); + #[cfg(target_family = "windows")] println!("Escape => clear all input"); println!("Ctrl-C => exit"); println!("Ctrl-D => EOF (when line empty)"); @@ -95,7 +96,10 @@ fn print_keys() { println!("Ctrl-T => transpose characters"); println!("Ctrl-V => insert special character"); println!("Ctrl-Y => paste yank"); - println!("Ctrl-Z => suspend (Unix), undo (Windows)"); + #[cfg(target_family = "unix")] + println!("Ctrl-Z => suspend"); + #[cfg(target_family = "windows")] + println!("Ctrl-Z => undo"); println!("Ctrl-_ => undo"); println!("Enter => run code"); println!("Shift-Ctrl-Enter => continue to next line");