diff --git a/src/Consolus/ConsoleRepl.cs b/src/Consolus/ConsoleRepl.cs index 5b6e395..fc4743c 100644 --- a/src/Consolus/ConsoleRepl.cs +++ b/src/Consolus/ConsoleRepl.cs @@ -440,7 +440,7 @@ private void Exit() Render(reset: true); - Console.Write($"{ConsoleStyle.BrightRed}^Z"); + Console.Write($"{ConsoleStyle.BrightRed}{(OperatingSystem.IsWindows()? "^Z" : "^D")}"); Console.ResetColor(); if (!ConsoleHelper.IsWindows) diff --git a/src/Kalk.Core/KalkEngine.Run.cs b/src/Kalk.Core/KalkEngine.Run.cs index e7eb9ca..2abbf5c 100644 --- a/src/Kalk.Core/KalkEngine.Run.cs +++ b/src/Kalk.Core/KalkEngine.Run.cs @@ -36,7 +36,8 @@ public bool Run(params string[] args) { ShowVersion(); WriteHighlightLine("# Type `help` for more information and at https://github.com/xoofx/kalk"); - WriteHighlightLine("# Type `exit` or CTRL+Z to exit from kalk"); + + WriteHighlightLine($"# Type `exit` or {(OperatingSystem.IsWindows() ? "CTRL+Z" : "CTRL+D")} to exit from kalk"); } // Load user config file after showing the version diff --git a/src/Kalk.Core/core.kalk b/src/Kalk.Core/core.kalk index 29b74ba..ec8575f 100644 --- a/src/Kalk.Core/core.kalk +++ b/src/Kalk.Core/core.kalk @@ -3,7 +3,13 @@ shortcut(cursor_left, "left, ctrl+b", action("cursor_left")) shortcut(cursor_right, "right, ctrl+f", action("cursor_right")) shortcut(history_previous, "up, ctrl+p", action("history_previous")) shortcut(history_next, "down, ctrl+n", action("history_next")) -shortcut(exit, "ctrl+z", action("exit")) +if env.os == "windows" + shortcut(exit, "ctrl+z", action("exit")) + shortcut(delete_right, "delete, ctrl+d", action("delete_right")) +else + shortcut(exit, "ctrl+d", action("exit")) + shortcut(delete_right, "delete", action("delete_right")) +end shortcut(copy, "ctrl+c", action("copy")) shortcut(cut, "ctrl+x", action("cut")) shortcut(paste, "ctrl+v", action("paste")) @@ -13,7 +19,6 @@ shortcut(cursor_line_start, "home, ctrl+a", action("cursor_line_start")) shortcut(cursor_line_end, "end, ctrl+e", action("cursor_line_end")) shortcut(completion, "tab", action("completion")) shortcut(delete_left, "backspace", action("delete_left")) -shortcut(delete_right, "delete, ctrl+d", action("delete_right")) shortcut(delete_word_left, "ctrl+backspace, ctrl+alt+b", action("delete_word_left")) shortcut(delete_word_right, "ctrl+delete, ctrl+alt+f", action("delete_word_right")) shortcut(validate_line, "enter", action("validate_line"))