Skip to content

fix: prevent ps command truncation hiding Claude sessions#28

Merged
graykode merged 1 commit intomainfrom
fix/ps-truncation
Apr 7, 2026
Merged

fix: prevent ps command truncation hiding Claude sessions#28
graykode merged 1 commit intomainfrom
fix/ps-truncation

Conversation

@graykode
Copy link
Copy Markdown
Owner

@graykode graykode commented Apr 7, 2026

Summary

  • macOS ps truncates the command column to terminal width by default. When Claude Code is launched as node /long/path/.../cli.js, the truncated output drops the claude token, so cmd_has_binary returns false and the session is treated as dead.
  • Add -ww to disable truncation. Column layout is unchanged, so existing parsing is unaffected.

Reported on Reddit: user had a live Claude session (PID 17786, session file present) but only Codex usage was showing in abtop.

Test plan

  • cargo build
  • Verify Claude sessions appear when launched via node wrapper

macOS ps truncates the command column to terminal width by default,
which caused cmd_has_binary to miss 'claude' when the actual argv was
'node /long/path/.../cli.js'. As a result, live Claude Code sessions
were incorrectly marked as dead and hidden from the UI.
@graykode graykode merged commit fc1db3b into main Apr 7, 2026
7 checks passed
@graykode graykode deleted the fix/ps-truncation branch April 7, 2026 07:25
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.

1 participant