[Bug]: Servers panel labels every macOS server "node"/"Python", ignoring process.title (Linux honors it)#32918

opened11d agobyFFaranIdo

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server

Steps to reproduce

  1. On macOS, open a T3 Code terminal in any project.
  2. Start two Node servers that each set a process title:
    sh
    1node -e 'process.title="api"; require("http").createServer().listen(4321)' &
    2node -e 'process.title="web"; require("http").createServer().listen(4322)' &
  3. Open the thread's Servers panel.

Expected behavior

The rows read Terminal · api and Terminal · web, which is what Linux shows for the same processes (/proc/<pid>/comm reflects process.title). The panel's label is the only way to tell which server is which.

Actual behavior

On macOS both rows read Terminal · node. Python servers all read Terminal · Python. In a project that runs several services, every row looks the same, so you can only tell them apart by port number.

The cause: on macOS the name comes from the c field of lsof -F pcn (apps/server/src/preview/PortScanner.ts, parseLsofOutput). That is the kernel's p_comm, which is fixed at exec to the executable's file name. process.title (and Python's setproctitle) only rewrites argv on macOS, so the label can never change.

ps already sees the title. For the repro above:

1$ ps -o pid=,command= -p <pid>
212345 api
3$ lsof -nP -iTCP:4321 -sTCP:LISTEN
4COMMAND PID ...
5node 12345 ...

Impact

Minor bug or occasional failure

Version or commit

0.1.7-nightly.20261102.4066; also reproduced on main @ 8e6a7323 in a dev build

Environment

macOS 26.4, T3 Code (Nightly) desktop

Suggested fix

On macOS, use the basename of the first word of ps -o command= (argv[0], which carries the process title) as processName, with the lsof name as the fallback. The scanner already runs ps -E -ww -o pid=,command= for listeners without a terminal owner (readAgentThreads), and caches per pid, so the same once-per-pid read could cover terminal-owned listeners too.

Workaround

Start each service from a hard link to the interpreter named after the service. A symlink doesn't work because macOS resolves it. This is awkward with npm scripts, whose #!/usr/bin/env node shebangs always find node.