Skip to content

Commit

Permalink
Breaking change: exiting on Mac and Linux is now using CTRL+D (Fixes #40
Browse files Browse the repository at this point in the history
)
  • Loading branch information
xoofx committed Sep 16, 2023
1 parent 22d6eea commit 2e53907
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Consolus/ConsoleRepl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion src/Kalk.Core/KalkEngine.Run.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 7 additions & 2 deletions src/Kalk.Core/core.kalk
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand All @@ -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"))
Expand Down

0 comments on commit 2e53907

Please sign in to comment.