Compare commits

..
1 Commits
Author SHA1 Message Date
OthmanAdi d8d5002736 fix(copilot-hooks): resolve garbled characters on Windows and non-ASCII systems
PowerShell scripts (all 4):
- Add $OutputEncoding and [Console]::OutputEncoding = UTF8 before any output
- Fixes diamond replacement characters (◆) caused by PowerShell 5.x
  defaulting to UTF-16LE stdout — Copilot reads stdout as UTF-8, causing
  the byte mismatch that produces garbled output on Windows systems

Bash scripts (session-start.sh, pre-tool-use.sh):
- Use json.dumps(..., ensure_ascii=False) instead of default ensure_ascii=True
- Preserves UTF-8 characters (CJK, emojis, accented letters) in task_plan.md
  context instead of converting them to raw \uXXXX escape sequences

README:
- Move Contributors from ugly bottom section into collapsible near top
- Add full contributors table with all PR authors since v2.8.0
- Add @Hexiaopi for Issue #82 bug report
- Update version badge and releases table to v2.16.1

CHANGELOG: add [2.16.1] entry

Fixes #82 — reported by @Hexiaopi
2026-02-25 19:32:00 +01:00
8 changed files with 53 additions and 7 deletions
+2
View File
@@ -4,6 +4,8 @@
# Always exits 0 — outputs JSON to stdout.
# Read stdin (required — Copilot pipes JSON to stdin)
$OutputEncoding = [System.Text.Encoding]::UTF8
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
$InputData = [Console]::In.ReadToEnd()
$PlanFile = "task_plan.md"
+2
View File
@@ -3,6 +3,8 @@
# Always exits 0 — outputs JSON to stdout.
# Read stdin (required — Copilot pipes JSON to stdin)
$OutputEncoding = [System.Text.Encoding]::UTF8
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
$InputData = [Console]::In.ReadToEnd()
$output = @{
+2
View File
@@ -4,6 +4,8 @@
# Always exits 0 — outputs JSON to stdout.
# Read stdin (required — Copilot pipes JSON to stdin)
$OutputEncoding = [System.Text.Encoding]::UTF8
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
$InputData = [Console]::In.ReadToEnd()
$PlanFile = "task_plan.md"
+1 -1
View File
@@ -23,7 +23,7 @@ fi
# Escape context for JSON
PYTHON=$(command -v python3 || command -v python)
ESCAPED=$(echo "$CONTEXT" | $PYTHON -c "import sys,json; print(json.dumps(sys.stdin.read()))" 2>/dev/null || echo "\"\"")
ESCAPED=$(echo "$CONTEXT" | $PYTHON -c "import sys,json; print(json.dumps(sys.stdin.read(), ensure_ascii=False))" 2>/dev/null || echo "\"\"")
echo "{\"hookSpecificOutput\":{\"hookEventName\":\"PreToolUse\",\"permissionDecision\":\"allow\",\"additionalContext\":$ESCAPED}}"
exit 0
+2
View File
@@ -4,6 +4,8 @@
# Always exits 0 — outputs JSON to stdout.
# Read stdin (required — Copilot pipes JSON to stdin)
$OutputEncoding = [System.Text.Encoding]::UTF8
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
$InputData = [Console]::In.ReadToEnd()
$PlanFile = "task_plan.md"
+1 -1
View File
@@ -36,7 +36,7 @@ if [ -z "$CONTEXT" ]; then
fi
# Escape context for JSON
ESCAPED=$(echo "$CONTEXT" | $PYTHON -c "import sys,json; print(json.dumps(sys.stdin.read()))" 2>/dev/null || echo "\"\"")
ESCAPED=$(echo "$CONTEXT" | $PYTHON -c "import sys,json; print(json.dumps(sys.stdin.read(), ensure_ascii=False))" 2>/dev/null || echo "\"\"")
echo "{\"hookSpecificOutput\":{\"hookEventName\":\"SessionStart\",\"additionalContext\":$ESCAPED}}"
exit 0
+14
View File
@@ -2,6 +2,20 @@
All notable changes to this project will be documented in this file.
## [2.16.1] - 2026-02-25
### Fixed
- **Copilot hooks garbled characters on Windows** (Issue #82, reported by @Hexiaopi)
- PowerShell scripts now set `$OutputEncoding` and `[Console]::OutputEncoding` to UTF-8 before any output — fixes garbled diamond characters (◆) caused by PowerShell 5.x defaulting to UTF-16LE stdout
- Bash scripts now use `json.dumps(..., ensure_ascii=False)` — preserves UTF-8 characters (emojis, accented letters, CJK) in `task_plan.md` instead of converting them to raw `XXXX` escape sequences
### Thanks
- @Hexiaopi for reporting the garbled characters issue (Issue #82)
---
## [2.16.0] - 2026-02-22
### Added
+29 -5
View File
@@ -28,13 +28,40 @@ If this skill helps you work smarter, that's all I wanted.
</details>
<details>
<summary><strong>🤝 Contributors</strong></summary>
Everyone who made this project better — bug reports, PRs, and integrations.
| Contributor | Contribution |
|-------------|-------------|
| [@lincolnwan](https://github.com/lincolnwan) | GitHub Copilot hooks support (PR #80) |
| [@gydx6](https://github.com/gydx6) | Session catchup false-positive fix (PR #79) |
| [@ciberponk](https://github.com/ciberponk) | Isolated plan sessions with UUID pinning (PR #77) |
| [@jonthebeef](https://github.com/jonthebeef) | `/plan:status` command (PR #75) |
| [@codelyc](https://github.com/codelyc) | OpenCode scripts + CodeBuddy path fixes (PRs #76, #70, #66) |
| [@ttttmr](https://github.com/ttttmr) | Pi Agent integration (PR #67) |
| [@AZLabsAI](https://github.com/AZLabsAI) | OpenClaw docs update (PR #65) |
| [@ZWkang](https://github.com/ZWkang) | CodeBuddy integration (PR #60) |
| [@SaladDay](https://github.com/SaladDay) | POSIX stop hook fix (PR #57) |
| [@murphyXu](https://github.com/murphyXu) | Continue IDE integration (PR #56) |
| [@Guozihong](https://github.com/Guozihong) | Start command (PR #51) |
| [@fahmyelraie](https://github.com/fahmyelraie) | Stop hook path resolution fix (PR #49) |
| [@olgasafonova](https://github.com/olgasafonova) | SkillCheck validation badge (PR #46) |
| [@lasmarois](https://github.com/lasmarois) | Session catchup cross-session improvements (PRs #37, #34) |
| [@RioTheGreat-ai](https://github.com/RioTheGreat-ai) | AgentFund community extension (PR #72) |
| [@Hexiaopi](https://github.com/Hexiaopi) | Copilot garbled characters bug report (Issue #82) |
</details>
<details>
<summary><strong>📦 Releases & Session Recovery</strong></summary>
### Current Version: v2.16.0
### Current Version: v2.16.1
| Version | Highlights |
|---------|------------|
| **v2.16.1** | Copilot garbled characters fix — PS1 UTF-8 encoding + bash ensure_ascii (thanks @Hexiaopi!) |
| **v2.16.0** | GitHub Copilot hooks support (thanks @lincolnwan!) |
| **v2.15.1** | Session catchup false-positive fix (thanks @gydx6!) |
| **v2.15.0** | `/plan:status` command, OpenCode compatibility fix |
@@ -107,7 +134,7 @@ A Claude Code plugin that transforms your workflow to use persistent markdown fi
[![AdaL CLI](https://img.shields.io/badge/AdaL%20CLI-Skills-9B59B6)](https://docs.sylph.ai/features/plugins-and-skills)
[![Pi Agent](https://img.shields.io/badge/Pi%20Agent-Skills-FF4081)](https://pi.dev)
[![GitHub Copilot](https://img.shields.io/badge/GitHub%20Copilot-Hooks-000000)](https://docs.github.com/en/copilot/reference/hooks-configuration)
[![Version](https://img.shields.io/badge/version-2.16.0-brightgreen)](https://github.com/OthmanAdi/planning-with-files/releases)
[![Version](https://img.shields.io/badge/version-2.16.1-brightgreen)](https://github.com/OthmanAdi/planning-with-files/releases)
[![SkillCheck Validated](https://img.shields.io/badge/SkillCheck-Validated-4c1)](https://getskillcheck.com)
## Quick Install
@@ -314,9 +341,6 @@ planning-with-files/
| [Pi Agent Setup](docs/pi-agent.md) | Pi Agent integration guide |
| [Copilot Setup](docs/copilot.md) | GitHub Copilot hooks integration guide |
## Contributors
- [@codelyc](https://github.com/codelyc) — OpenCode scripts support
## Acknowledgments