Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for subshells breaks escaped parentheses #234

Closed
luangong opened this issue Feb 3, 2024 · 1 comment
Closed

Support for subshells breaks escaped parentheses #234

luangong opened this issue Feb 3, 2024 · 1 comment

Comments

@luangong
Copy link

luangong commented Feb 3, 2024

Running the following code with deno:

import $ from 'https://deno.land/x/dax/mod.ts';

await $`echo \( foo bar \)`;

An error will be produced:

error: Uncaught (in promise) "Unexpected character.\n  ( bar )\n  ~"

The expected output is:

( foo bar )

Given the following content of deno.json:

{
  "tasks": {
    "paren": "echo ( foo bar )",
    "paren2": "echo \\( foo bar \\)",
    "paren3": "echo \\(\nfoo bar\n\\)"
  }
}

And running deno task paren2 and deno task paren3 both produce the expected output:

$ deno task paren2
Task paren2 echo \( foo bar \)
( foo bar )

$ deno task paren3
Task paren3 echo \(
foo bar
\)
( foo bar )

Support for escaped parentheses was added in denoland/deno_task_shell#99, but it seems that #232 broke it.

Related:

@luangong
Copy link
Author

luangong commented Feb 3, 2024

It seems that it requires double-escaping. The following code works:

import $ from 'https://deno.land/x/dax/mod.ts';

await $`echo \\( foo bar \\)`;

@luangong luangong closed this as not planned Won't fix, can't repro, duplicate, stale Feb 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant