Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New custom print function to handle windows unicode #131

Merged
merged 6 commits into from
Nov 30, 2024

Conversation

z1fire
Copy link
Collaborator

@z1fire z1fire commented Nov 30, 2024

The custom print function checks if on windows and if so it changes the way the terminal behaves just for that print function else just prints as normal

@@ -0,0 +1,41 @@
const std = @import("std");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this belongs in cli/util.zig - we already import this in cli/commands/init.zig.

original: if (builtin.os.tag == .windows) c_uint else void,

fn init() !UTF8ConsoleOutput {
if (builtin.os.tag == .windows) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you flip this around you can use a guard clause to remove some indentation:

if (builtin.os.tag != .windows) return .{ .original = {} };
// ... windows logic

@bobf
Copy link
Contributor

bobf commented Nov 30, 2024

@z1fire Ready to merge - thanks a lot, Windows users deserve icons too. ❤️

@z1fire z1fire merged commit 31f8a4a into jetzig-framework:main Nov 30, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants