Skip to content

new lsof usage is extremely slow in Cursor/VSCode integrated terminal #21284

@maschwenk

Description

@maschwenk

HOMEBREW_SHELL_NAME="$(/usr/sbin/lsof -w -p "${PPID}" -a -d cwd -Fc | /usr/bin/sed -n "s/^c//p")"

I haven't quite gotten to the bottom of it yet, but these PRs

have caused Cursor agent to be really slow when creating a new shell. On my machine where I have a lot of open files, this command takes almost 4 seconds, whereas in terminal.app it does not. I can't totally understand why this is happening but a few others can reproduce the same issue.

I appears that some aspect of the indirection of spawning shells inside Cursor makes the -p optimization not work well.

lsof is known to be very slow when:

  • You have low disk space
  • You don't use any of the flags that make it faster

so this may be something to raise to Cursor, but given a lot of folks use Cursor/VSCode, I think this is relevant

Metadata

Metadata

Assignees

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