Skip to content

Comments

add cmd option for prise.spawn#86

Open
jossephus wants to merge 2 commits intorockorager:mainfrom
jossephus:feat/add-cmd-option-for-spawn
Open

add cmd option for prise.spawn#86
jossephus wants to merge 2 commits intorockorager:mainfrom
jossephus:feat/add-cmd-option-for-spawn

Conversation

@jossephus
Copy link
Contributor

@jossephus jossephus commented Jan 11, 2026

add cmd option for prise.spawn enabling execution of a command from prise.spawn.

  prise.spawn({ cmd = {  "npm run dev" } })

Closes #65 with a slight difference when specifying the command.

@jossephus jossephus mentioned this pull request Jan 11, 2026
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

The implementation adds a cmd parameter to spawn PTY requests, allowing an initial command to be executed. The overall structure is clean and follows the existing patterns well.

Issues found:

  1. Partial write risk (server.zig:2273): The return value of posix.write is discarded, which could result in truncated commands for longer inputs.
  2. Potential race condition (server.zig:2269): The command is written immediately after PTY creation, but the shell may not be fully initialized yet.

The client-side changes and UI integration look correct.


Review context: https://ampcode.com/threads/T-019bafe3-3f81-756d-b252-899591d296aa

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.

Add custom command support to prise.spawn()

1 participant