Skip to content

Command Code overwrites its process name with the terminal title #764

Description

@ogulcancelik

Summary

I maintain Herdr, a terminal runtime that detects coding agents from the foreground process.

I’m trying to add Command Code support, but Command Code replaces its process name and command line with the current terminal title. That title changes with the project or session, so there is no stable name Herdr can detect.

Expected Behavior

Command Code should keep a stable process name such as command-code. The terminal tab title can still show the project or session name through the normal OSC escape sequence.

Actual Behavior

I launched Command Code with command-code. Once the UI started, Linux reported:

comm:    ⌘ Command Cod
cmdline: ⌘ Command Code · review-pr-3332-command-code
exe:     /home/can/.local/share/fnm/node-versions/v24.15.0/installation/bin/node

The original command and node_modules/command-code/dist/index.mjs path are both gone. Linux truncates the changing title even further in comm.

The published package appears to couple the terminal title and process title:

function writeTitle(title) {
  setProcessTitle(title)
  process.stderr.isTTY && process.stderr.write(oscTitle(title))
}

Steps to reproduce the issue

  1. Start Command Code on Linux:

    command-code
  2. From another terminal, inspect the process:

    pid=$(pgrep -n -f 'Command Code ·')
    ps -p "$pid" -o comm=,args=
    tr '\0' ' ' < "/proc/$pid/cmdline"
    readlink "/proc/$pid/exe"
  3. The process name and command line now contain the changing terminal title instead of a stable Command Code identity.

Command Code Version

1.38.1

Operating System

Linux

Terminal/IDE

Ghostty, running through Herdr

Shell

zsh

Additional context

The npm aliases cmd, cmdc, command-code, and commandcode all end up with the same changing process title.

Could you keep process.title stable as command-code, or stop changing it? The terminal title can continue changing independently. Without a stable process identity, I can’t add reliable Command Code detection to Herdr.

More generally, using a changing terminal title as the process identity makes Command Code harder to inspect, monitor, and integrate with using standard CLI tooling such as ps, top, and process supervisors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions