Clicking a coder_app terminal button creates a new PTY each time instead of reconnecting to the same session, which causes terminal and TUI state to be lost.
Add an opt-in behavior for coder_app terminals that shows the user's running sessions and lets them choose one to reconnect to, rather than always starting a new PTY. This preserves terminal and TUI state when an existing session is selected. When there are no running sessions, launching the app creates a new PTY, matching the current behavior.
resource "coder_app" "claude" {
agent_id = coder_agent.dev.id
slug = "claude"
display_name = "Claude"
command = "claude"
show_running_sessions = true // optional; defaults to false
}
Clicking a
coder_appterminal button creates a new PTY each time instead of reconnecting to the same session, which causes terminal and TUI state to be lost.Add an opt-in behavior for
coder_appterminals that shows the user's running sessions and lets them choose one to reconnect to, rather than always starting a new PTY. This preserves terminal and TUI state when an existing session is selected. When there are no running sessions, launching the app creates a new PTY, matching the current behavior.