Skip to content

fix: keep setup's background servers and end the port mirror with pier - #42

Merged
kerem-kaynak merged 3 commits into
mainfrom
docs/demo-gif
Sep 28, 2026
Merged

kerem-kaynak merged 3 commits into
mainfrom
docs/demo-gif

Conversation

@kerem-kaynak

Copy link
Copy Markdown
Collaborator

Two lifetime fixes, and the README demo recorded against the current app.

  • Setup's background servers survive the setup window. A server that .pier/setup.sh started with & could be killed when the window closed, because the terminal hangup raced the script's exit. Setup now runs in its own session with stdin detached, so background jobs it starts keep running.
  • The port mirror ends with pier. The connection that mirrors a session's ports to the laptop while attached could outlive pier if pier exited abnormally, and kept holding the local ports. Its lifetime is now tied to a pipe only pier holds, so it ends however pier exits. Stopping it is also bounded instead of waiting on -O exit.
  • Demo. The README GIF and its tape are regenerated for the current app: create, attach, pier proxy, resize and delete.

When a setup script ends, its tmux window closes and the terminal hangs up
on the window's session. A server the script started in the background
last went with it — even wrapped in setsid, which races the script's exit.
Setup now runs in its own session with no terminal (setsid -w, stdin from
/dev/null), so nothing it starts is hung up on; the exit status still
reaches the outcome file.

The app also sorts sessions by name: the cloud returns instances in no
fixed order, and rows that swapped between refreshes moved the cursor.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Your trial has ended. Reactivate Greptile to resume code reviews.

@kerem-kaynak
kerem-kaynak merged commit 3909192 into main Sep 28, 2026
3 checks passed
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