Skip to content

vt --title-mode <mode> … passes as single argv token, so fwd parser doesn’t consume it (v1.0.0-beta.15) #568

@IkechukwuAbuah

Description

@IkechukwuAbuah

Hi! I’m seeing what looks like an argv/quoting bug in vt’s wrapper script.

Version

  • VibeTunnel v1.0.0-beta.15

Expected
vt --title-mode dynamic echo test runs echo test with title mode set.

Actual
The flag isn’t consumed by vibetunnel fwd, and --title-mode … appears to get treated as part of the spawned command (often surfacing as zsh “no such option: title_mode”).

Root cause
In web/bin/vt, TITLE_MODE_ARGS is constructed as a string with a space:

TITLE_MODE_ARGS="--title-mode $2"

but passed as a single argv token due to quoting:

${TITLE_MODE_ARGS:+"$TITLE_MODE_ARGS"}

So the forwarder receives a single argument like --title-mode dynamic (one token), but web/src/server/fwd.ts only parses --title-mode when it’s a separate argv element (remainingArgs[0] === '--title-mode').

Minimal reproduction (argv capture)
If I swap VIBETUNNEL_BIN for a tiny argv dumper, vt clearly passes --title-mode <mode> as one token:

env -u VIBETUNNEL_SESSION_ID OSTYPE=linux-gnu \
  VIBETUNNEL_BIN=/path/to/argvdump.sh \
  SHELL=/bin/zsh \
  ./web/bin/vt --title-mode dynamic echo test

Output includes:

argv[1]=--title-mode\ dynamic

Suggested fix
Represent TITLE_MODE_ARGS as an array and expand it safely:

TITLE_MODE_ARGS=()
if [[ "$1" == "--title-mode" && $# -gt 1 ]]; then
  TITLE_MODE_ARGS=(--title-mode "$2")
  shift 2
fiexec${VERBOSITY_ARGS:+$VERBOSITY_ARGS} "${TITLE_MODE_ARGS[@]}"

Optionally, accept --title-mode=<mode> in vt (and/or in the forwarder parser) for UX.

Thanks — happy to test a patch.

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