pixi icon indicating copy to clipboard operation
pixi copied to clipboard

`pixi run` fails when inner command contains `~`

Open liskajiri opened this issue 1 year ago • 3 comments

Checks

  • [x] I have checked that this issue has not already been reported.

  • [x] I have confirmed this bug exists on the latest version of pixi, using pixi --version.

Reproducible example

[project]
channels = ["https://prefix.dev/conda-forge"]
name = "."
platforms = ["linux-64"]

[tasks]
download_cifar = "curl -o cifar-10-python.tar.gz https://www.cs.toronto.edu/~kriz/cifar-10-python.tar.gz"

Outputs:

❯ pixi run download_cifar
✨ Pixi task (download_cifar): curl -o cifar-10-python.tar.gz https://www.cs.toronto.edu/~kriz/cifar-10-python.tar.gz
Error:
  × The task failed to parse. task: 'curl -o cifar-10-python.tar.gz https://www.cs.toronto.edu/~kriz/
  │ cifar-10-python.tar.gz ' error: 'Unexpected character.
  │   ~kriz/cifar-10-python.tar.gz
  │   ~'

Issue description

A task will fail when it contains the ~ character. This is probably the same error as #727

The task works when the command is escaped (like in the referenced issue).

[project]
channels = ["https://prefix.dev/conda-forge"]
name = "."
platforms = ["linux-64"]

[tasks]
download_cifar = "curl -o cifar-10-python.tar.gz \"https://www.cs.toronto.edu/~kriz/cifar-10-python.tar.gz\""

run on version pixi 0.40.2

Expected behavior

The task should work without escaping, or only escaping the tilde.

liskajiri avatar Jan 21 '25 13:01 liskajiri

thanks for reporting this! I will take a look

nichtmacho avatar Jan 21 '25 14:01 nichtmacho

Related PR: https://github.com/denoland/deno_task_shell/pull/128

Hofer-Julian avatar Jan 29 '25 13:01 Hofer-Julian

Not reproducible in latest pixi version. Likely fixed in the task shell.

baszalmstra avatar May 27 '26 12:05 baszalmstra