Skip to content

Interactive PTY: tab completion does nothing in the VM shell #1894

Description

@jog1t

Summary

Tab completion does nothing in the interactive VM shell. Pressing Tab (or writing a raw \t byte to the PTY) produces no completion, no candidate list, and no bell — the byte is simply consumed.

This is server-side, not a terminal-client problem: it reproduces by writing \t straight to the PTY with no browser involved.

Reproduction

import { AgentOs } from "@rivet-dev/agentos-core";
import common from "@agentos-software/common";

const vm = await AgentOs.create({ software: [common] });
const shell = await vm.terminal.open({ cols: 80, rows: 24 });
const id = shell.shellId;
let buf = "";
vm.onShellData(id, (e) => { buf += Buffer.from(e?.data ?? e).toString("utf8"); });
await new Promise((r) => setTimeout(r, 1500));

buf = "";
await vm.terminal.write(id, "una\t");
await new Promise((r) => setTimeout(r, 3000));
console.log(JSON.stringify(buf));

Observed: "una" — the echoed prefix only.

Expected (bash/zsh behavior): completes to uname, since /opt/agentos/bin/uname exists and is on PATH.

Possible cause

software/coreutils/native/crates/cmd-sh/Cargo.toml enables both interactive backends:

brush-shell = { version = "0.3.0", default-features = false, features = ["reedline", "minimal"] }

The adjacent comment describes minimal as "an explicit opt-out backend", so if minimal is the backend actually selected on wasm32-wasip1, no completer is wired up. That matches the observation that Tab produces nothing at all rather than a failed or empty completion attempt.

If that is the cause, this may be a feature-flag/backend-selection fix rather than a change to brush itself.

Note

The Cargo manifest pins brush-shell 0.3.0, but the live prompt renders as sh-0.4$. Worth confirming which build is actually being executed before digging in — it may indicate the running sh is not the pinned one.

Related

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