Skip to content

Conversation

@Higangssh
Copy link
Contributor

@Higangssh Higangssh commented Oct 14, 2025

Fixes #106

Problem

The context-monitor fails to read transcript files on Windows due to encoding mismatch. The script doesn't specify
encoding, so it defaults to cp949 on Windows, which can't handle UTF-8 content.

Solution

Added explicit UTF-8 encoding to the file open call:

with open(transcript_path, 'r', encoding='utf-8', errors='replace') as f:

This follows Python best practices and ensures the code works across all platforms.

Testing

Tested on Windows 11 with Python 3.13. The statusline now correctly displays context information instead of "???".

Changes

  • Modified line 18 in cli-tool/components/settings/statusline/context-monitor.py
  • 1 file changed, 1 insertion(+), 1 deletion(-)

Image

  • Before
image
  • After
image

Fixes file reading error on Windows where the default encoding (cp949)
fails to read UTF-8 transcript files. Adding explicit encoding='utf-8'
with errors='replace' ensures cross-platform compatibility.
@vercel
Copy link

vercel bot commented Oct 14, 2025

@Higangssh is attempting to deploy a commit to the Daniel Avila's projects Team on Vercel.

A member of the Team first needs to authorize it.

@davila7 davila7 merged commit 6bd3eff into davila7:main Oct 14, 2025
1 check failed
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.

[Bug] context-monitor statusline fails on Windows due to encoding

2 participants