Skip to content

"failed: exit status 1" when using "read -p" in a dynamic variable #2518

@Xav-Pe

Description

@Xav-Pe

Description

When creating a task (this is a sample):

version: '3'
tasks:
  mytask:
    vars:
      VALUE: 
        sh: read -p "test var ? " test && echo "$test"
    cmds:
      - echo {{.VALUE}}

And running it with task -vvv --taskfile ./test_var.yml mytask, i have this error (and that's the only one output despite the -vvv) :

task: Command "read -p "test var ? " test && echo "$test"" failed: exit status 1

Since read -p should be supported from the 3.9 version (here )I'm supposing this is a bug.

Is it known?

Version

3.45.4

Operating system

RHEL9 and Ubuntu 25.04, fish and bash

Experiments Enabled

Remote Taskfiles

Example Taskfile

version: '3'
tasks:
  mytask:
    vars:
      VALUE: 
        sh: read -p "test var ? " test && echo "$test"
    cmds:
      - echo {{.VALUE}}

Metadata

Metadata

Assignees

No one assigned

    Labels

    state: needs triageWaiting to be triaged by a maintainer.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions