lionkor / lionkor/commandline

Use WinAPI functions on Windows

Open
#8 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
C++
Stars
95
Forks
16
PR merge metrics
No merged PRs in 30d

Description

Currently we're using ANSI escape codes on both Unix/Linux/MacOS and Windows, which causes issues in Windows (of course).

They decided that Powershell and the Windows Terminal (!= CMD) should not behave properly when presented with ANSI escape codes, even with that feature explicitly enabled.

So, instead of getting really angry with windows' decisions, we are just going to use their WinAPI features to do what we do with ANSI escape sequences currently.

Snarkiness aside, the goal is to replace all ANSI escape codes (`\0x1b` prefixed stuff in all calls to `printf`) with the equivalent Windows API function call.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Inspect the calls to printf that contain ANSI escape codes (the \0x1b-prefixed sequences) and trace how terminal output is handled on each platform. Confirm the equivalent Windows API behavior for those operations, then verify that Windows no longer relies on those ANSI sequences while Unix/Linux/MacOS behavior remains unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
cli, operating-systems
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.