fix: suppress opencode fork stdout and strip ANSI codes from logs #197
Reference in New Issue
Block a user
Delete Branch "fix/issue-session-id-and-log-cleanup"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Bugs Fixed
1. Session ID corruption in create_session
Problem:
opencode run --forkoutputs the session title to stdout, which was being captured and stored as the session ID.Example of corrupted session file:
Fix: Suppress stdout from
opencode run --fork --session ... "new session" >/dev/null 2>&12. ANSI codes in logs
Problem: Logs contained ANSI escape codes (
^[[0m), command prompts, and noise.Fix: Added
strip_ansi_codes()function and updatedcmd_logsto clean output.3. mask_sensitive_vars empty input bug
Fix: Changed
$1to${1:-}to handle empty input gracefully.Changes
kugetsu-session.sh: Suppress stdout fromopencode run --forkkugetsu-config.sh: Addstrip_ansi_codes()functionkugetsu-log.sh: Strip ANSI codes incmd_logsoutputlgtm