Skip to content

SSH commands freeze on interactive input — need -T flag and stdin redirect #51

@nsluss

Description

@nsluss

Problem

When pi is connected to a remote VM via vers_vm_use, running a bash command that prompts for interactive input (e.g. tailscale up, apt-get install with Y/N) causes the pi session to freeze permanently (or until the 120s timeout).

Root Cause

In extensions/vers-vm.ts, the execStreaming() and exec() methods spawn SSH without:

  1. The -T flag (disable pseudo-terminal allocation)
  2. Stdin redirect from /dev/null for remote commands

SSH forwards stdin to the remote process. When the remote process blocks on input, SSH blocks, pi blocks. Permanent freeze.

Proposed Fix

Two changes in extensions/vers-vm.ts:

  1. Add -T to sshArgs() to disable PTY allocation
  2. Wrap remote commands: < /dev/null ${command} in both execStreaming() and exec()

This prevents remote processes from ever blocking on stdin, while preserving stdout/stderr capture.

Context

Metadata

Metadata

Assignees

No one assigned

    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